[FIX] nfu_product_bnn_attributes: make packages company dependend

This commit is contained in:
Niels Göttsch 2024-10-14 15:25:02 +02:00
parent 329a52e680
commit a1a04bdf86
5 changed files with 13 additions and 3 deletions

View file

@ -35,6 +35,7 @@ Changelog
:1.0.0: Initial module.
:1.1.0: Add packaging
:1.1.1: inherit package company if from product
Bug Tracker
===========

View file

@ -4,7 +4,7 @@
"author": "BAKEUP",
"website": "https://www.bakeup.org",
"category": "Product",
"version": "16.0.1.1.0",
"version": "16.0.1.1.1",
"depends": ["product"],
"data": ["views/product_bnn_views.xml"],
"assets": {},

View file

@ -28,6 +28,12 @@ class ProductTemplate(models.Model):
packagings.write({"name": name, "qty": qty, "sales": True})
else:
self.env["product.packaging"].create(
{"name": name, "qty": qty, "product_id": product_product.id, "sales": True}
{
"name": name,
"qty": qty,
"product_id": product_product.id,
"sales": True,
"company_id": product_product.company_id.id,
}
)
return res

View file

@ -1,3 +1,4 @@
:1.0.0: Initial module.
:1.1.0: Add packaging
:1.1.1: inherit package company if from product

View file

@ -394,6 +394,8 @@ ul.auto-toc {
</tr>
<tr class="field"><th class="field-name">1.1.0:</th><td class="field-body">Add packaging</td>
</tr>
<tr class="field"><th class="field-name">1.1.1:</th><td class="field-body">inherit package company if from product</td>
</tr>
</tbody>
</table>
</div>