from odoo import models, fields, api class MrpProduction(models.Model): _inherit = 'mrp.production' hide_quality_check_button = fields.Boolean(compute='_compute_hide_quality_check_button') @api.depends_context('uid') def _compute_hide_quality_check_button(self): for record in self: record.hide_quality_check_button = not self.env.user.allowed_quality_checks def action_confirm(self): return super(MrpProduction, self.with_context(bypass_user_restriction=True)).action_confirm() def button_mark_done(self): return super(MrpProduction, self.with_context(bypass_user_restriction=True)).button_mark_done()