From b3d30969a430d87bd58780d79b57e88c72291d69 Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Wed, 8 Aug 2018 10:18:35 +0200 Subject: [PATCH] [IMP] stock: do not use rule name in origin We don't want to use the name of the rule that created a move anymore, so we propagate the origin of previous move if it has any and, use the picking name of the previous move if doesn't hav any origin. This behaviour make more sense as it will alway keep the origin of the document that trigger the creation of a move. TASK-1838639 --- addons/stock/models/stock_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index 827f9c5a6ee..42cec8a7709 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -754,7 +754,7 @@ class StockMove(models.Model): # create procurements for make to order moves for move in move_create_proc: values = move._prepare_procurement_values() - origin = (move.group_id and move.group_id.name or (move.rule_id and move.rule_id.name or move.origin or move.picking_id.name or "/")) + origin = (move.group_id and move.group_id.name or (move.origin or move.picking_id.name or "/")) self.env['procurement.group'].run(move.product_id, move.product_uom_qty, move.product_uom, move.location_id, move.rule_id and move.rule_id.name or "/", origin, values)