diff --git a/addons/mrp/models/mrp_workorder.py b/addons/mrp/models/mrp_workorder.py
index d5d40384a59..1fcc9ca6f47 100644
--- a/addons/mrp/models/mrp_workorder.py
+++ b/addons/mrp/models/mrp_workorder.py
@@ -115,9 +115,9 @@ class MrpWorkorder(models.Model):
'stock.move.line', 'workorder_id', 'Moves to Track',
help="Inventory moves for which you must scan a lot number at this work order")
finished_lot_id = fields.Many2one(
- 'stock.lot', string='Lot/Serial Number', compute='_compute_finished_lot_id',
- inverse='_set_finished_lot_id', domain="[('product_id', '=', product_id), ('company_id', '=', company_id)]",
- check_company=True)
+ 'stock.lot', string='Lot/Serial Number', related='production_id.lot_producing_id',
+ domain="[('product_id', '=', product_id), ('company_id', '=', company_id)]",
+ readonly=False, check_company=True)
time_ids = fields.One2many(
'mrp.workcenter.productivity', 'workorder_id', copy=False)
is_user_working = fields.Boolean(
@@ -218,15 +218,6 @@ class MrpWorkorder(models.Model):
'replan': color_icon not in [False, 'text-primary']
})
- @api.depends('production_id.lot_producing_id')
- def _compute_finished_lot_id(self):
- for workorder in self:
- workorder.finished_lot_id = workorder.production_id.lot_producing_id
-
- def _set_finished_lot_id(self):
- for workorder in self:
- workorder.production_id.lot_producing_id = workorder.finished_lot_id
-
@api.depends('production_id.qty_producing')
def _compute_qty_producing(self):
for workorder in self:
diff --git a/addons/mrp/views/mrp_workorder_views.xml b/addons/mrp/views/mrp_workorder_views.xml
index 5bbbc2670c8..6fea3f086ae 100644
--- a/addons/mrp/views/mrp_workorder_views.xml
+++ b/addons/mrp/views/mrp_workorder_views.xml
@@ -8,6 +8,7 @@
+
@@ -258,6 +259,7 @@
+
@@ -415,6 +417,7 @@
+
@@ -438,7 +441,7 @@