22 lines
833 B
Python
22 lines
833 B
Python
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()
|
|
|
|
@api.model_create_multi
|
|
def create(self, vals_list):
|
|
return super(MrpProduction, self.with_context(bypass_user_restriction=True)).create(vals_list)
|