[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
This commit is contained in:
Pierre Masereel
2018-08-08 17:39:02 +02:00
parent 64f6e50d0c
commit b3d30969a4
+1 -1
View File
@@ -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)