From 8bd4f438b18a36b7cfc41628c01e80dbae17b458 Mon Sep 17 00:00:00 2001 From: Nans Lefebvre Date: Wed, 5 Jun 2019 09:15:39 +0000 Subject: [PATCH] [FIX] stock: create backorder for all pickings in a batch Create two pickings, add them to a batch. Set a quantity less than the order to done on each. Confirm and set to done. A wizard asks if a backorder should be created. If confirmed, the first picking is done with a backorder but not the second. Since the method is in api.multi, we can simply get all pickings. opw 2004727 closes odoo/odoo#33902 Signed-off-by: Arnold Moyaux --- 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 0d0fb1a68cd..4ae162788f3 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -1137,7 +1137,7 @@ class StockMove(models.Model): .filtered(lambda p: p.quant_ids and len(p.quant_ids) > 1): if len(result_package.quant_ids.mapped('location_id')) > 1: raise UserError(_('You cannot move the same package content more than once in the same transfer or split the same package into two location.')) - picking = moves_todo and moves_todo[0].picking_id or False + picking = moves_todo.mapped('picking_id') moves_todo.write({'state': 'done', 'date': fields.Datetime.now()}) moves_todo.mapped('move_dest_ids')._action_assign()