[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
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user