sf工单优化及权限
This commit is contained in:
@@ -19,6 +19,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
_order = 'sequence'
|
||||
|
||||
workcenter_id = fields.Many2one('mrp.workcenter', required=False)
|
||||
users_ids = fields.Many2many("res.users", 'users_workorder', related="workcenter_id.users_ids")
|
||||
processing_panel = fields.Char('加工面')
|
||||
sequence = fields.Integer(string='工序')
|
||||
routing_type = fields.Selection([
|
||||
@@ -29,6 +30,21 @@ class ResMrpWorkOrder(models.Model):
|
||||
('后置三元质量检测', '后置三元质量检测'),
|
||||
('解除装夹', '解除装夹'),
|
||||
], string="工序类型")
|
||||
|
||||
@api.onchange('users_ids')
|
||||
def get_user_permissions(self):
|
||||
uid = self.env.uid
|
||||
for workorder in self:
|
||||
if workorder.users_ids:
|
||||
for item in workorder.users_ids:
|
||||
if item.id == uid:
|
||||
workorder.user_permissions = True
|
||||
else:
|
||||
workorder.user_permissions = False
|
||||
else:workorder.user_permissions=False
|
||||
|
||||
|
||||
user_permissions = fields.Boolean('用户权限', compute='get_user_permissions')
|
||||
cnc_worksheet = fields.Binary(
|
||||
'工作指令', readonly=True)
|
||||
material_center_point = fields.Char(string='配料中心点')
|
||||
|
||||
Reference in New Issue
Block a user