diff --git a/nfu_product/README.rst b/nfu_product/README.rst
index aa2abdf..b7c6b8d 100644
--- a/nfu_product/README.rst
+++ b/nfu_product/README.rst
@@ -32,7 +32,8 @@ NFU Product
Changelog
=========
-* 1.0.0: Initial module.
+- 16.0.1.0.0: Initial module.
+- 16.0.1.1.0: Add multi company to product packagings
Bug Tracker
diff --git a/nfu_product/__manifest__.py b/nfu_product/__manifest__.py
index 3a42650..739d50c 100644
--- a/nfu_product/__manifest__.py
+++ b/nfu_product/__manifest__.py
@@ -4,8 +4,12 @@
"author": "BAKEUP",
"website": "https://www.bakeup.org",
"category": "product",
- "version": "16.0.1.0.0",
- "depends": ["product", "product_multi_company"],
- "data": ["views/product_product_views.xml", "views/product_template_views.xml"],
+ "version": "16.0.1.1.0",
+ "depends": ["product_multi_company"],
+ "data": [
+ "views/product_packaging_views.xml",
+ "views/product_product_views.xml",
+ "views/product_template_views.xml",
+ ],
"license": "LGPL-3",
}
diff --git a/nfu_product/models/__init__.py b/nfu_product/models/__init__.py
index e69de29..2c4d9a8 100644
--- a/nfu_product/models/__init__.py
+++ b/nfu_product/models/__init__.py
@@ -0,0 +1 @@
+from . import product_packaging
diff --git a/nfu_product/models/product_packaging.py b/nfu_product/models/product_packaging.py
new file mode 100644
index 0000000..96f09b4
--- /dev/null
+++ b/nfu_product/models/product_packaging.py
@@ -0,0 +1,14 @@
+from odoo import api, models
+
+
+class ProductPackaging(models.Model):
+ _inherit = ["multi.company.abstract", "product.packaging"]
+ _name = "product.packaging"
+
+ @api.model_create_multi
+ def create(self, vals_list):
+ res = super().create(vals_list)
+ for packaging in res:
+ product = packaging.product_id
+ packaging.company_ids = product.company_ids
+ return res
diff --git a/nfu_product/readme/HISTORY.rst b/nfu_product/readme/HISTORY.rst
index 8e4bb94..da2cb2f 100644
--- a/nfu_product/readme/HISTORY.rst
+++ b/nfu_product/readme/HISTORY.rst
@@ -1,2 +1,3 @@
-* 1.0.0: Initial module.
+- 16.0.1.0.0: Initial module.
+- 16.0.1.1.0: Add multi company to product packagings
diff --git a/nfu_product/static/description/index.html b/nfu_product/static/description/index.html
index 67ecc26..75a7ba6 100644
--- a/nfu_product/static/description/index.html
+++ b/nfu_product/static/description/index.html
@@ -389,7 +389,8 @@ ul.auto-toc {
-- 1.0.0: Initial module.
+- 16.0.1.0.0: Initial module.
+- 16.0.1.1.0: Add multi company to product packagings
diff --git a/nfu_product/views/product_packaging_views.xml b/nfu_product/views/product_packaging_views.xml
new file mode 100644
index 0000000..4c50d21
--- /dev/null
+++ b/nfu_product/views/product_packaging_views.xml
@@ -0,0 +1,41 @@
+
+
+
+ product.packaging.tree.inherit.companies
+ product.packaging
+
+
+
+ 1
+
+
+
+
+
+
+
+
+ product.packaging.form.inherit.companies
+ product.packaging
+
+
+
+ 1
+
+
+
+
+
+
+
diff --git a/nfu_product_bnn_attributes/README.rst b/nfu_product_bnn_attributes/README.rst
index 92e9f41..13aadb9 100644
--- a/nfu_product_bnn_attributes/README.rst
+++ b/nfu_product_bnn_attributes/README.rst
@@ -33,9 +33,10 @@ Changelog
=========
-:1.0.0: Initial module.
-:1.1.0: Add packaging
-:1.1.1: inherit package company if from product
+- 16.0.1.0.0: Initial module.
+- 16.0.1.1.0: Add packaging
+- 16.0.1.1.1: inherit package company if from product
+- 16.0.1.2.0: Add Multi company to packaging
Bug Tracker
===========
diff --git a/nfu_product_bnn_attributes/__manifest__.py b/nfu_product_bnn_attributes/__manifest__.py
index d57bdf2..2b7cf85 100644
--- a/nfu_product_bnn_attributes/__manifest__.py
+++ b/nfu_product_bnn_attributes/__manifest__.py
@@ -4,8 +4,8 @@
"author": "BAKEUP",
"website": "https://www.bakeup.org",
"category": "Product",
- "version": "16.0.1.1.1",
- "depends": ["product"],
+ "version": "16.0.1.2.0",
+ "depends": ["nfu_product"],
"data": ["views/product_bnn_views.xml"],
"assets": {},
"license": "LGPL-3",
diff --git a/nfu_product_bnn_attributes/models/product_template.py b/nfu_product_bnn_attributes/models/product_template.py
index 1f881c8..406ce82 100644
--- a/nfu_product_bnn_attributes/models/product_template.py
+++ b/nfu_product_bnn_attributes/models/product_template.py
@@ -33,7 +33,7 @@ class ProductTemplate(models.Model):
"qty": qty,
"product_id": product_product.id,
"sales": True,
- "company_id": product_product.company_id.id,
+ "company_ids": product_product.company_ids.ids,
}
)
return res
diff --git a/nfu_product_bnn_attributes/readme/HISTORY.rst b/nfu_product_bnn_attributes/readme/HISTORY.rst
index 426e549..8d7d5ba 100644
--- a/nfu_product_bnn_attributes/readme/HISTORY.rst
+++ b/nfu_product_bnn_attributes/readme/HISTORY.rst
@@ -1,4 +1,5 @@
-:1.0.0: Initial module.
-:1.1.0: Add packaging
-:1.1.1: inherit package company if from product
\ No newline at end of file
+- 16.0.1.0.0: Initial module.
+- 16.0.1.1.0: Add packaging
+- 16.0.1.1.1: inherit package company if from product
+- 16.0.1.2.0: Add Multi company to packaging
\ No newline at end of file
diff --git a/nfu_product_bnn_attributes/static/description/index.html b/nfu_product_bnn_attributes/static/description/index.html
index f6d6f70..44dd16f 100644
--- a/nfu_product_bnn_attributes/static/description/index.html
+++ b/nfu_product_bnn_attributes/static/description/index.html
@@ -386,18 +386,12 @@ ul.auto-toc {
-
-
-
-
-| 1.0.0: | Initial module. |
-
-| 1.1.0: | Add packaging |
-
-| 1.1.1: | inherit package company if from product |
-
-
-
+
+- 16.0.1.0.0: Initial module.
+- 16.0.1.1.0: Add packaging
+- 16.0.1.1.1: inherit package company if from product
+- 16.0.1.2.0: Add Multi company to packaging
+