summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Galler <ngl@odoo.com>2020-11-23 16:08:12 +0000
committerNicolas Galler <ngl@odoo.com>2020-11-26 16:21:40 +0000
commit0281dee6da75e68403772ebd368d57c1feb98c37 (patch)
tree437ed3a41ca30de8f7099068162bd0759e2fd8cf
parent2b7670e6d709cd311c630c99cb9da7d3d6ae90f4 (diff)
[FIX] mrp: carry over origin from source move in 3-step mfr
Behavior prior to this commit: - when the warehouse uses a 3-step manufacturing process, if I create a Sales Order, the MO generated does not show the SO# as "Source", instead it shows the MO# Behavior after this commit: - the MO source shows the SO# (similar to how it works when using the 2-step or the 1-step manufacturing process) - the origins are assigned thus: - Delivery Picking = SO name - Post-prod Picking = SO name - MO = SO name - Pre-prod Picking = MO name Note: - there is no implementation change in this commit - we just ported the test from the original commit in 13.0 (the behavior in 14.0 was already OK) opw-2380717 closes odoo/odoo#62432 X-original-commit: 0bc86a8d575a5392f3eebf17ac30359cc1121888 Signed-off-by: Nicolas Galler <ngaller@users.noreply.github.com>
-rw-r--r--addons/mrp/tests/test_warehouse_multistep_manufacturing.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/addons/mrp/tests/test_warehouse_multistep_manufacturing.py b/addons/mrp/tests/test_warehouse_multistep_manufacturing.py
index 9f1509673fb..d9e6f840950 100644
--- a/addons/mrp/tests/test_warehouse_multistep_manufacturing.py
+++ b/addons/mrp/tests/test_warehouse_multistep_manufacturing.py
@@ -150,11 +150,14 @@ class TestMultistepManufacturingWarehouse(TestMrpCommon):
'location_id': self.warehouse.wh_output_stock_loc_id.id,
'location_dest_id': self.customer_location,
'procure_method': 'make_to_order',
+ 'origin': 'SOURCEDOCUMENT',
'state': 'draft',
})
picking_customer.action_confirm()
production_order = self.env['mrp.production'].search([('product_id', '=', self.finished_product.id)])
self.assertTrue(production_order)
+ self.assertEqual(production_order.origin, 'SOURCEDOCUMENT', 'The MO origin should be the SO name')
+ self.assertNotEqual(production_order.name, 'SOURCEDOCUMENT', 'The MO name should not be the origin of the move')
picking_stock_preprod = self.env['stock.move'].search([
('product_id', '=', self.raw_product.id),
@@ -173,6 +176,8 @@ class TestMultistepManufacturingWarehouse(TestMrpCommon):
self.assertTrue(picking_stock_postprod)
self.assertEqual(picking_stock_preprod.state, 'confirmed')
self.assertEqual(picking_stock_postprod.state, 'waiting')
+ self.assertEqual(picking_stock_preprod.origin, production_order.name, 'The pre-prod origin should be the MO name')
+ self.assertEqual(picking_stock_postprod.origin, 'SOURCEDOCUMENT', 'The post-prod origin should be the SO name')
picking_stock_preprod.action_assign()
picking_stock_preprod.move_line_ids.qty_done = 4