From 8c8b32e5e437e8c18179f267ec47959c4ebeff9d Mon Sep 17 00:00:00 2001 From: Arnold Moyaux Date: Fri, 4 Jan 2019 14:15:35 +0000 Subject: [PATCH] [FIX] mrp: manufacture user can not record production Usecase to reproduce: - Connect with demo user - Create a MO w/h routing - Confirm and produce it - Record the production wizard Access right error on product.product for field tracking It happens because the wizard use a related to product.tracking howerver it is not set as readonly on the view and send to the server as a value on save. Since it write on a related field it will try to write on the linked model(product.product). This commit set the field as readonly so it is not set to the server. The field is just used inside domain and it is invisible to the user so it do not modify any behavior. opw-1918684 closes odoo/odoo#29942 --- addons/mrp/wizard/mrp_product_produce.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/wizard/mrp_product_produce.py b/addons/mrp/wizard/mrp_product_produce.py index b51f50cd452..36c8decbaf3 100644 --- a/addons/mrp/wizard/mrp_product_produce.py +++ b/addons/mrp/wizard/mrp_product_produce.py @@ -85,7 +85,7 @@ class MrpProductProduce(models.TransientModel): product_uom_id = fields.Many2one('product.uom', 'Unit of Measure') lot_id = fields.Many2one('stock.production.lot', string='Lot') produce_line_ids = fields.One2many('mrp.product.produce.line', 'product_produce_id', string='Product to Track') - product_tracking = fields.Selection(related="product_id.tracking") + product_tracking = fields.Selection(related="product_id.tracking", readonly=True) @api.multi def do_produce(self):