access_restriction_by_user/models/mrp_production.py

12 lines
398 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