diff --git a/mrp_multi_level/__manifest__.py b/mrp_multi_level/__manifest__.py
index 568a509c2..cb031387b 100644
--- a/mrp_multi_level/__manifest__.py
+++ b/mrp_multi_level/__manifest__.py
@@ -4,7 +4,7 @@
{
"name": "MRP Multi Level",
- "version": "15.0.1.7.0",
+ "version": "16.0.1.0.0",
"development_status": "Production/Stable",
"license": "LGPL-3",
"author": "Ucamco, ForgeFlow, Odoo Community Association (OCA)",
diff --git a/mrp_multi_level/demo/initial_on_hand_demo.xml b/mrp_multi_level/demo/initial_on_hand_demo.xml
index 2cf9a7c8e..20f5e5b6d 100644
--- a/mrp_multi_level/demo/initial_on_hand_demo.xml
+++ b/mrp_multi_level/demo/initial_on_hand_demo.xml
@@ -30,13 +30,14 @@
eval="obj().env.ref('stock.warehouse0').lot_stock_id.id"
/>
-
-
+
-
+
+
diff --git a/mrp_multi_level/demo/product_supplierinfo_demo.xml b/mrp_multi_level/demo/product_supplierinfo_demo.xml
index eaecfa523..59c643866 100644
--- a/mrp_multi_level/demo/product_supplierinfo_demo.xml
+++ b/mrp_multi_level/demo/product_supplierinfo_demo.xml
@@ -2,42 +2,42 @@
-
+
4
0
100
-
+
4
0
100
-
+
4
0
100
-
+
4
0
100
-
+
4
0
100
-
+
2
0
100
@@ -45,7 +45,7 @@
-
+
2
0
10
@@ -53,7 +53,7 @@
-
+
3
0
80
diff --git a/mrp_multi_level/models/__init__.py b/mrp_multi_level/models/__init__.py
index 0ebdf3353..708a1ebdb 100644
--- a/mrp_multi_level/models/__init__.py
+++ b/mrp_multi_level/models/__init__.py
@@ -8,3 +8,4 @@ from . import mrp_inventory
from . import product_mrp_area
from . import stock_rule
from . import mrp_production
+from . import stock_quant
diff --git a/mrp_multi_level/models/product_mrp_area.py b/mrp_multi_level/models/product_mrp_area.py
index d8f43c43d..68103ad44 100644
--- a/mrp_multi_level/models/product_mrp_area.py
+++ b/mrp_multi_level/models/product_mrp_area.py
@@ -211,7 +211,7 @@ class ProductMRPArea(models.Model):
rec.main_supplier_id = False
continue
rec.main_supplierinfo_id = suppliers[0]
- rec.main_supplier_id = suppliers[0].name
+ rec.main_supplier_id = suppliers[0].partner_id
for rec in self.filtered(lambda r: r.supply_method != "buy"):
rec.main_supplierinfo_id = False
rec.main_supplier_id = False
diff --git a/mrp_multi_level/models/stock_quant.py b/mrp_multi_level/models/stock_quant.py
new file mode 100644
index 000000000..4cb59b680
--- /dev/null
+++ b/mrp_multi_level/models/stock_quant.py
@@ -0,0 +1,16 @@
+# Copyright 2022 ForgeFlow S.L. (https://www.forgeflow.com)
+# - Joan Sisquella Andrés
+# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
+from odoo import api, models
+
+
+class StockQuant(models.Model):
+ _inherit = "stock.quant"
+
+ @api.model
+ def _get_inventory_fields_write(self):
+ """
+ Adding field product_uom_id, inventory_quantity
+ """
+ fields = super(StockQuant, self)._get_inventory_fields_write()
+ return fields + ["product_uom_id", "inventory_quantity"]
diff --git a/mrp_multi_level/readme/CONTRIBUTORS.rst b/mrp_multi_level/readme/CONTRIBUTORS.rst
index 025ca73b1..6f4590cee 100644
--- a/mrp_multi_level/readme/CONTRIBUTORS.rst
+++ b/mrp_multi_level/readme/CONTRIBUTORS.rst
@@ -3,3 +3,4 @@
* Lois Rilo
* Héctor Villarreal
* Christopher Ormaza
+* Joan Sisquella
diff --git a/mrp_multi_level/tests/common.py b/mrp_multi_level/tests/common.py
index 7c9095186..b8bc051f3 100644
--- a/mrp_multi_level/tests/common.py
+++ b/mrp_multi_level/tests/common.py
@@ -103,7 +103,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"list_price": 150.0,
"produce_delay": 5.0,
"route_ids": [(6, 0, [route_buy])],
- "seller_ids": [(0, 0, {"name": vendor1.id, "price": 20.0})],
+ "seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 20.0})],
}
)
cls.product_mrp_area_obj.create(
@@ -123,7 +123,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"type": "product",
"list_price": 50.0,
"route_ids": [(6, 0, [route_buy])],
- "seller_ids": [(0, 0, {"name": vendor1.id, "price": 10.0})],
+ "seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 10.0})],
}
)
cls.product_mrp_area_obj.create(
@@ -142,7 +142,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"type": "product",
"list_price": 50.0,
"route_ids": [(6, 0, [route_buy])],
- "seller_ids": [(0, 0, {"name": vendor1.id, "price": 10.0})],
+ "seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 10.0})],
}
)
cls.product_mrp_area_obj.create(
@@ -160,7 +160,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"type": "product",
"list_price": 50.0,
"route_ids": [(6, 0, [route_buy])],
- "seller_ids": [(0, 0, {"name": vendor1.id, "price": 10.0})],
+ "seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 10.0})],
}
)
cls.product_mrp_area_obj.create(
@@ -179,7 +179,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"type": "product",
"list_price": 100.0,
"route_ids": [(6, 0, [route_buy])],
- "seller_ids": [(0, 0, {"name": vendor1.id, "price": 20.0})],
+ "seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 20.0})],
}
)
cls.product_mrp_area_obj.create(
@@ -197,7 +197,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"type": "product",
"list_price": 100.0,
"route_ids": [(6, 0, [route_buy])],
- "seller_ids": [(0, 0, {"name": vendor1.id, "price": 20.0})],
+ "seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 20.0})],
}
)
cls.product_mrp_area_obj.create(
@@ -213,7 +213,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"list_price": 150.0,
"produce_delay": 5.0,
"route_ids": [(6, 0, [route_buy])],
- "seller_ids": [(0, 0, {"name": vendor1.id, "price": 20.0})],
+ "seller_ids": [(0, 0, {"partner_id": vendor1.id, "price": 20.0})],
}
)
cls.product_mrp_area_obj.create(
@@ -248,7 +248,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"location_id": cls.stock_location.id,
"location_dest_id": cls.customer_location.id,
"scheduled_date": date_move,
- "move_lines": [
+ "move_ids": [
(
0,
0,
@@ -313,7 +313,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"location_id": cls.stock_location.id,
"location_dest_id": cls.customer_location.id,
"scheduled_date": date_move,
- "move_lines": [
+ "move_ids": [
(
0,
0,
@@ -439,7 +439,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"location_id": cls.sec_loc.id,
"location_dest_id": cls.customer_location.id,
"scheduled_date": date_move,
- "move_lines": [
+ "move_ids": [
(
0,
0,
@@ -481,7 +481,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"location_id": cls.supplier_location.id,
"location_dest_id": location.id,
"scheduled_date": date_move,
- "move_lines": [
+ "move_ids": [
(
0,
0,
@@ -511,7 +511,7 @@ class TestMrpMultiLevelCommon(TransactionCase):
"location_id": location.id,
"location_dest_id": cls.customer_location.id,
"scheduled_date": date_move,
- "move_lines": [
+ "move_ids": [
(
0,
0,
diff --git a/mrp_multi_level/views/mrp_inventory_views.xml b/mrp_multi_level/views/mrp_inventory_views.xml
index d16dab2f9..bae8c6e70 100644
--- a/mrp_multi_level/views/mrp_inventory_views.xml
+++ b/mrp_multi_level/views/mrp_inventory_views.xml
@@ -57,6 +57,7 @@
name="action_open_planned_orders"
type="object"
icon="fa-list"
+ title="Details"
/>