From 7e6b259c78291cc9407110c151c61ac57db4473e Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Tue, 22 May 2018 16:20:58 +0200 Subject: [PATCH] [FIX] stock: is_initial_demand_editable computation When we perform a planned transfer (which is the default behaviour now) we are not able to set a quantity done on move lines in a confirmed move because, the field 'is_initial_demand_editable' is true but should not. To fix this, we set 'is_initial_demand_editable' to true when it is not a planned transfer AND the state of the move is draft, which is the desired behaviour. This behaviour come from rev:https://github.com/odoo/odoo/commit/ffb79761c1225c8a9c9303db4781f1b40b5d9944 --- 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 843681a6f04..a84c057c7dd 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -200,7 +200,7 @@ class StockMove(models.Model): @api.depends('state', 'picking_id') def _compute_is_initial_demand_editable(self): for move in self: - if not move.picking_id.immediate_transfer: + if not move.picking_id.immediate_transfer and move.state == 'draft': move.is_initial_demand_editable = True elif not move.picking_id.is_locked and move.state != 'done' and move.picking_id: move.is_initial_demand_editable = True