[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
This commit is contained in:
Pierre Masereel
2018-05-22 17:13:45 +02:00
parent e434690fe3
commit 7e6b259c78
+1 -1
View File
@@ -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