No data to display
diff --git a/addons/mrp/views/res_config_settings_views.xml b/addons/mrp/views/res_config_settings_views.xml
index 229ff502fc6..115a1d14338 100644
--- a/addons/mrp/views/res_config_settings_views.xml
+++ b/addons/mrp/views/res_config_settings_views.xml
@@ -20,13 +20,10 @@
- Process operations at specific work centers based on the routing
+ Process operations at specific work centers
-
-
-
diff --git a/addons/mrp/views/stock_move_views.xml b/addons/mrp/views/stock_move_views.xml
index 7f0273418cd..06fc52fac22 100644
--- a/addons/mrp/views/stock_move_views.xml
+++ b/addons/mrp/views/stock_move_views.xml
@@ -31,8 +31,8 @@
/
-
-
+
+
diff --git a/addons/mrp/wizard/change_production_qty.py b/addons/mrp/wizard/change_production_qty.py
index 468681982bb..3ced315c703 100644
--- a/addons/mrp/wizard/change_production_qty.py
+++ b/addons/mrp/wizard/change_production_qty.py
@@ -80,7 +80,7 @@ class ChangeProductionQty(models.TransientModel):
production._log_manufacture_exception(documents)
operation_bom_qty = {}
for bom, bom_data in boms:
- for operation in bom.routing_id.operation_ids:
+ for operation in bom.operation_ids:
operation_bom_qty[operation.id] = bom_data['qty']
finished_moves_modification = self._update_finished_moves(production, production.product_qty - qty_produced, old_production_qty)
production._log_downside_manufactured_quantity(finished_moves_modification)
diff --git a/addons/mrp_account/models/product.py b/addons/mrp_account/models/product.py
index 61f067b020a..72f32617d02 100644
--- a/addons/mrp_account/models/product.py
+++ b/addons/mrp_account/models/product.py
@@ -47,7 +47,7 @@ class ProductProduct(models.Model):
if not boms_to_recompute:
boms_to_recompute = []
total = 0
- for opt in bom.routing_id.operation_ids:
+ for opt in bom.operation_ids:
duration_expected = (
opt.workcenter_id.time_start +
opt.workcenter_id.time_stop +
diff --git a/addons/mrp_account/tests/test_bom_price.py b/addons/mrp_account/tests/test_bom_price.py
index b015080a883..813a8c2b6a8 100644
--- a/addons/mrp_account/tests/test_bom_price.py
+++ b/addons/mrp_account/tests/test_bom_price.py
@@ -19,7 +19,7 @@ class TestBom(common.TransactionCase):
super(TestBom, self).setUp()
self.Product = self.env['product.product']
self.Bom = self.env['mrp.bom']
- self.Routing = self.env['mrp.routing']
+ #self.Routing = self.env['mrp.routing']
self.operation = self.env['mrp.routing.workcenter']
# Products.
@@ -117,37 +117,63 @@ class TestBom(common.TransactionCase):
workcenter_from1.costs_hour = 100
workcenter_1 = workcenter_from1.save()
- routing_form1 = Form(self.Routing)
- routing_form1.name = 'Assembly Furniture'
- routing_1 = routing_form1.save()
+ self.bom_1.write({
+ 'operation_ids': [
+ (0, 0, {
+ 'name': 'Cutting',
+ 'workcenter_id': workcenter_1.id,
+ 'time_mode': 'manual',
+ 'time_cycle_manual': 20,
+ 'batch': 'no',
+ 'sequence': 1,
+ }),
+ (0, 0, {
+ 'name': 'Drilling',
+ 'workcenter_id': workcenter_1.id,
+ 'time_mode': 'manual',
+ 'time_cycle_manual': 25,
+ 'batch': 'no',
+ 'sequence': 2,
+ }),
+ (0, 0, {
+ 'name': 'Fitting',
+ 'workcenter_id': workcenter_1.id,
+ 'time_mode': 'manual',
+ 'time_cycle_manual': 30,
+ 'batch': 'no',
+ 'sequence': 3,
+ }),
+ ],
+ }),
+ self.bom_2.write({
+ 'operation_ids': [
+ (0, 0, {
+ 'name': 'Cutting',
+ 'workcenter_id': workcenter_1.id,
+ 'time_mode': 'manual',
+ 'time_cycle_manual': 20,
+ 'batch': 'no',
+ 'sequence': 1,
+ }),
+ (0, 0, {
+ 'name': 'Drilling',
+ 'workcenter_id': workcenter_1.id,
+ 'time_mode': 'manual',
+ 'time_cycle_manual': 25,
+ 'batch': 'no',
+ 'sequence': 2,
+ }),
+ (0, 0, {
+ 'name': 'Fitting',
+ 'workcenter_id': workcenter_1.id,
+ 'time_mode': 'manual',
+ 'time_cycle_manual': 30,
+ 'batch': 'no',
+ 'sequence': 3,
+ }),
+ ],
+ }),
- operation_1 = self.operation.create({
- 'name': 'Cutting',
- 'workcenter_id': workcenter_1.id,
- 'routing_id': routing_1.id,
- 'time_mode': 'manual',
- 'time_cycle_manual': 20,
- 'batch': 'no',
- 'sequence': 1,
- })
- operation_2 = self.operation.create({
- 'name': 'Drilling',
- 'workcenter_id': workcenter_1.id,
- 'routing_id': routing_1.id,
- 'time_mode': 'manual',
- 'time_cycle_manual': 25,
- 'batch': 'no',
- 'sequence': 2,
- })
- operation_3 = self.operation.create({
- 'name': 'Fitting',
- 'workcenter_id': workcenter_1.id,
- 'routing_id': routing_1.id,
- 'time_mode': 'manual',
- 'time_cycle_manual': 30,
- 'batch': 'no',
- 'sequence': 3,
- })
# -----------------------------------------------------------------
# Dinning Table Operation Cost(1 Unit)
@@ -160,7 +186,6 @@ class TestBom(common.TransactionCase):
# Operation Cost 1 unit = 125
# -----------------------------------------------------------------
- self.bom_1.routing_id = routing_1.id
# --------------------------------------------------------------------------
# Table Head Operation Cost (1 Dozen)
@@ -173,7 +198,6 @@ class TestBom(common.TransactionCase):
# Operation Cost 1 dozen (125 per dozen) and 10.42 for 1 Unit
# --------------------------------------------------------------------------
- self.bom_2.routing_id = routing_1.id
self.assertEqual(self.dining_table.standard_price, 1000, "Initial price of the Product should be 1000")
self.dining_table.button_bom_cost()
diff --git a/addons/mrp_account/tests/test_mrp_account.py b/addons/mrp_account/tests/test_mrp_account.py
index 8bb590c6986..7f1660f3170 100644
--- a/addons/mrp_account/tests/test_mrp_account.py
+++ b/addons/mrp_account/tests/test_mrp_account.py
@@ -66,7 +66,6 @@ class TestMrpAccount(TestWorkOrderProcessCommon):
})
inventory.action_validate
bom = self.mrp_bom_desk.copy()
- bom.routing_id = False # TODO: extend the test later with the necessary operations
production_table_form = Form(self.env['mrp.production'])
production_table_form.product_id = self.dining_table
production_table_form.bom_id = bom
diff --git a/addons/mrp_landed_costs/tests/test_stock_landed_costs_mrp.py b/addons/mrp_landed_costs/tests/test_stock_landed_costs_mrp.py
index 97e9863b029..134ba08f893 100644
--- a/addons/mrp_landed_costs/tests/test_stock_landed_costs_mrp.py
+++ b/addons/mrp_landed_costs/tests/test_stock_landed_costs_mrp.py
@@ -37,16 +37,12 @@ class TestStockLandedCostsMrp(StockAccountTestCommon):
'type': 'product',
'categ_id': cls.categ_all.id
})
- cls.routing_1 = cls.env['mrp.routing'].create({
- 'name': 'Simple Line',
- })
cls.uom_unit = cls.env.ref('uom.product_uom_unit')
cls.bom_refri = cls.env['mrp.bom'].create({
'product_id': cls.product_refrigerator.id,
'product_tmpl_id': cls.product_refrigerator.product_tmpl_id.id,
'product_uom_id': cls.uom_unit.id,
'product_qty': 1.0,
- 'routing_id': cls.routing_1.id,
'type': 'normal',
})
cls.bom_refri_line1 = cls.env['mrp.bom.line'].create({
diff --git a/addons/mrp_product_expiry/tests/test_mrp_product_expiry.py b/addons/mrp_product_expiry/tests/test_mrp_product_expiry.py
index 0633317f6b1..e5dda34c14d 100644
--- a/addons/mrp_product_expiry/tests/test_mrp_product_expiry.py
+++ b/addons/mrp_product_expiry/tests/test_mrp_product_expiry.py
@@ -64,14 +64,6 @@ class TestStockProductionLot(TestStockCommon):
'time_stop': 5,
'time_efficiency': 80,
})
- cls.routing = cls.env['mrp.routing'].create({'name': 'COOK'})
- cls.operation = cls.env['mrp.routing.workcenter'].create({
- 'name': 'Bake in the oven',
- 'workcenter_id': cls.workcenter.id,
- 'routing_id': cls.routing.id,
- 'time_cycle': 15,
- 'sequence': 1,
- })
def test_01_product_produce(self):
""" Checks user doesn't get a confirmation wizard when they produces with
@@ -122,7 +114,14 @@ class TestStockProductionLot(TestStockCommon):
""" Checks user doesn't get a confirmation wizard when they makes a
workorder without expired components. """
# Set a routing on the BOM.
- self.bom_apple_pie.routing_id = self.routing
+ self.bom_apple_pie.write({
+ 'operation_ids': [(0, 0, {
+ 'name': 'Bake in the oven',
+ 'workcenter_id': self.workcenter.id,
+ 'time_cycle': 15,
+ 'sequence': 1,
+ })],
+ })
# Creates the MO, starts it and plans the Work Order.
mo_form = Form(self.env['mrp.production'])
mo_form.product_id = self.product_apple_pie
@@ -149,7 +148,14 @@ class TestStockProductionLot(TestStockCommon):
""" Checks user doesn't get a confirmation wizard when they makes a
workorder without expired components. """
# Set a routing on the BOM.
- self.bom_apple_pie.routing_id = self.routing
+ self.bom_apple_pie.write({
+ 'operation_ids': [(0, 0, {
+ 'name': 'Bake in the oven',
+ 'workcenter_id': self.workcenter.id,
+ 'time_cycle': 15,
+ 'sequence': 1,
+ })],
+ })
# Creates the MO, starts it and plans the Work Order.
mo_form = Form(self.env['mrp.production'])
mo_form.product_id = self.product_apple_pie