From 858cb6534b1930de801ea51b5e40aa77bec54e08 Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Thu, 14 Sep 2017 11:25:26 +0200 Subject: [PATCH] [FIX] stock: barckorder on move with mulitple move_line When a move is set to done and a backorder should be create, we get a traceback saying that we cannot set the quantity done on a move with multiple move move_lines. This occurs, when the stock move has multiple move lines with quantity done set to 0; Because the new move only contains move lines having quantity done 0, we remove the useless line that set the quantity done on the move --- addons/stock/models/stock_move.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index f7bfab2faed..e9776589de0 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -913,7 +913,6 @@ class StockMove(models.Model): # If you were already putting stock.move.lots on the next one in the work order, transfer those to the new move move.move_line_ids.filtered(lambda x: x.qty_done == 0.0).write({'move_id': new_move}) - self.browse(new_move).quantity_done = 0.0 move.move_line_ids.action_done() picking = self and self[0].picking_id or False moves_todo.write({'state': 'done', 'date': fields.Datetime.now()})