From cc39341fc2401fc8a37a1354d2cc47f1d1e338e3 Mon Sep 17 00:00:00 2001 From: Arnold Moyaux Date: Mon, 24 Jul 2023 13:23:27 +0000 Subject: [PATCH] [FIX] mrp: demo data for shop floor We only show the move that requires a manual operation in the shop floor application. Currently we only see the MO for table top with a single operation to register the finished serial. It's a bit funnier to see also the components required and check them Also the manual_consumption field is a compute store without inverse. It means it's readonly true by default. But we should be able to pass a value and use it instead of the compute X-original-commit: 58118291e148a144058c0c883ddd138187a86f3d Part-of: odoo/odoo#131707 --- addons/mrp/data/mrp_demo.xml | 1 + addons/mrp/models/mrp_bom.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/mrp/data/mrp_demo.xml b/addons/mrp/data/mrp_demo.xml index 8254a58b224..f46759e8f22 100644 --- a/addons/mrp/data/mrp_demo.xml +++ b/addons/mrp/data/mrp_demo.xml @@ -310,6 +310,7 @@ 2 + True 1 diff --git a/addons/mrp/models/mrp_bom.py b/addons/mrp/models/mrp_bom.py index bc0c0990aa8..823020766ef 100644 --- a/addons/mrp/models/mrp_bom.py +++ b/addons/mrp/models/mrp_bom.py @@ -455,7 +455,8 @@ class MrpBomLine(models.Model): attachments_count = fields.Integer('Attachments Count', compute='_compute_attachments_count') tracking = fields.Selection(related='product_id.tracking') manual_consumption = fields.Boolean( - 'Manual Consumption', default=False, compute='_compute_manual_consumption', store=True, copy=True, + 'Manual Consumption', default=False, compute='_compute_manual_consumption', + readonly=False, store=True, copy=True, help="When activated, then the registration of consumption for that component is recorded manually exclusively.\n" "If not activated, and any of the components consumption is edited manually on the manufacturing order, Odoo assumes manual consumption also.") manual_consumption_readonly = fields.Boolean(