-
-
+
+
+ /
+
+
@@ -30,12 +37,17 @@
+
+
+
+
-
+
-
+
+
@@ -43,13 +55,9 @@
-
+
-
diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py
index 1ee84e00d9a..b1221f1424e 100644
--- a/addons/stock/models/stock_move.py
+++ b/addons/stock/models/stock_move.py
@@ -154,11 +154,18 @@ class StockMove(models.Model):
picking_code = fields.Selection(related='picking_id.picking_type_id.code', readonly=True)
product_type = fields.Selection(related='product_id.type', readonly=True)
additional = fields.Boolean("Whether the move was added after the picking's confirmation", default=False)
- is_locked = fields.Boolean(related='picking_id.is_locked', readonly=True)
+ is_locked = fields.Boolean(compute='_compute_is_locked', readonly=True)
is_initial_demand_editable = fields.Boolean('Is initial demand editable', compute='_compute_is_initial_demand_editable')
is_quantity_done_editable = fields.Boolean('Is quantity done editable', compute='_compute_is_quantity_done_editable')
reference = fields.Char(compute='_compute_reference', string="Reference", store=True)
+ @api.depends('picking_id.is_locked')
+ def _compute_is_locked(self):
+ for move in self:
+ if move.picking_id:
+ move.is_locked = move.picking_id.is_locked
+
+
@api.depends('product_id', 'has_tracking', 'move_line_ids', 'location_id', 'location_dest_id')
def _compute_show_details_visible(self):
""" According to this field, the button that calls `action_show_details` will be displayed