Merge pull request #22 from bakeupboys/92-16.0-make_package_creation_company_dependend

92 16.0 make package creation company dependend
This commit is contained in:
madmooose 2024-10-14 15:46:38 +02:00 committed by GitHub
commit ce6989e680
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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.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>