From d8221eab30159f03caf5c17144b9ca4e69fce950 Mon Sep 17 00:00:00 2001 From: William Henrotin Date: Mon, 16 Apr 2018 10:20:33 +0200 Subject: [PATCH] [FIX] stock: update qty_done in move wizard Scenario : Create a transfer on a product tracking by lot. Update the operation type "Receipt" by unchecking the "show reserved" option. Open the Register lots, pack, location wizard and set some lots with a quantity done. The quantity done field is not updated in real time. Issue : The depends function on quantity_done is triggered only on move_line_ids but "show reserverd" option replace move_line_ids by move_line_nosuggest_ids in the wizard. --- addons/stock/models/stock_move.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index c1af5ed0b19..f0b5ac65196 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -243,9 +243,9 @@ class StockMove(models.Model): """ This will return the move lines to consider when applying _quantity_done_compute on a stock.move. In some context, such as MRP, it is necessary to compute quantity_done on filtered sock.move.line.""" self.ensure_one() - return self.move_line_ids + return self.move_line_ids or self.move_line_nosuggest_ids - @api.depends('move_line_ids.qty_done', 'move_line_ids.product_uom_id') + @api.depends('move_line_ids.qty_done', 'move_line_ids.product_uom_id', 'move_line_nosuggest_ids.qty_done') def _quantity_done_compute(self): """ This field represents the sum of the move lines `qty_done`. It allows the user to know if there is still work to do.