[FIX] stock: Don't take into account canceled moves to check for backorder

Do a transfer in two steps with several move lines (e.g.: Vendors => Input => Stock).

In the first picking, set quantity = 0 on a single line. Transfer it and say 'No backorder'.

In the second picking, set all quantities (you have two move lines confirmed and one canceled). Validate the
transfer. The backorder wizard is launched. It should not.

closes odoo/odoo#66680

X-original-commit: 79d834f2c2ec167831fe0986afb728207a467d67
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
This commit is contained in:
Denis Roussel
2021-02-23 12:16:52 +00:00
committed by Arnold Moyaux
parent 7f72f5f7ea
commit d80d79efa3
+1 -1
View File
@@ -986,7 +986,7 @@ class Picking(models.Model):
for picking in self:
quantity_todo = {}
quantity_done = {}
for move in picking.mapped('move_lines'):
for move in picking.mapped('move_lines').filtered(lambda m: m.state != "cancel"):
quantity_todo.setdefault(move.product_id.id, 0)
quantity_done.setdefault(move.product_id.id, 0)
quantity_todo[move.product_id.id] += move.product_uom._compute_quantity(move.product_uom_qty, move.product_id.uom_id, rounding_method='HALF-UP')