From 8a6162d00d1cc1cf709f1a98c775ab4de8eabc19 Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Tue, 13 Nov 2018 12:28:24 +0100 Subject: [PATCH] [FIX] mrp: User with no products write access cannot create production order As the product_tmpl_id field is related one but not readonly, the creation of production order triggers a write on product.product model --- addons/mrp/models/mrp_production.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index cfc80e4415d..342894ccd3a 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -53,7 +53,7 @@ class MrpProduction(models.Model): domain=[('type', 'in', ['product', 'consu'])], readonly=True, required=True, states={'confirmed': [('readonly', False)]}) - product_tmpl_id = fields.Many2one('product.template', 'Product Template', related='product_id.product_tmpl_id') + product_tmpl_id = fields.Many2one('product.template', 'Product Template', related='product_id.product_tmpl_id', readonly=True) product_qty = fields.Float( 'Quantity To Produce', default=1.0, digits=dp.get_precision('Product Unit of Measure'),