diff options
| author | Denis Roussel <denis.roussel@acsone.eu> | 2021-02-13 11:33:47 +0000 |
|---|---|---|
| committer | Arnold Moyaux <arm@odoo.com> | 2021-02-23 09:54:32 +0000 |
| commit | 79d834f2c2ec167831fe0986afb728207a467d67 (patch) | |
| tree | fdcab4ebba9f5522f003f8158999d6b5b177ccaa /addons/stock | |
| parent | 07577f40e237daadcb45e19ab28d81385e368ee6 (diff) | |
[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#66272
X-original-commit: 25ae2416b08c6b3b1805b1f5de7df283d3a8ef0c
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Diffstat (limited to 'addons/stock')
| -rw-r--r-- | addons/stock/models/stock_picking.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py index e0408e7e99d..9230d0530af 100644 --- a/addons/stock/models/stock_picking.py +++ b/addons/stock/models/stock_picking.py @@ -998,7 +998,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') |
