From bde1fe704ae855bec95118e982ffb4f839a53f2e Mon Sep 17 00:00:00 2001 From: clesgow Date: Thu, 7 Apr 2022 08:51:24 +0000 Subject: [PATCH] [FIX] mrp: procure_method lost on mrp backorders When creating a backorder for a manufacturing order, procure method for its moves are lost in the process, as the the field is set to copy False. But the split of a manufacturing order is not a usual copy case. In this specific case, we need to keep the procure_method of the copied moves, as it keeps the two/three-steps routes working for the splitted manufacturing order. Task-2797359 closes odoo/odoo#88208 Signed-off-by: Arnold Moyaux --- addons/mrp/models/stock_move.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/mrp/models/stock_move.py b/addons/mrp/models/stock_move.py index 8d460f68a6d..6e299685e37 100644 --- a/addons/mrp/models/stock_move.py +++ b/addons/mrp/models/stock_move.py @@ -420,7 +420,8 @@ class StockMove(models.Model): 'reservation_date': self.reservation_date, 'manual_consumption': self.bom_line_id.manual_consumption or self.product_id.tracking != 'none', 'move_orig_ids': [Command.link(m.id) for m in self.mapped('move_orig_ids')], - 'move_dest_ids': [Command.link(m.id) for m in self.mapped('move_dest_ids')] + 'move_dest_ids': [Command.link(m.id) for m in self.mapped('move_dest_ids')], + 'procure_method': self.procure_method, } def _get_source_document(self):