增加刀具管理权限控制,刀具组权限控制,隐藏工单上原生按钮,修复只读权限后修改记录无权限问题等

This commit is contained in:
mgw
2024-01-19 11:49:57 +08:00
parent cffda26ed0
commit 2dfd3c9128
10 changed files with 125 additions and 93 deletions

View File

@@ -194,7 +194,8 @@ class sf_production_plan(models.Model):
record.date_planned_start, record.date_planned_finished = \
item.date_planned_start, item.date_planned_finished
record.state = 'done'
record.production_id.schedule_state = '已排'
# record.production_id.schedule_state = '已排'
record.sudo().production_id.schedule_state = '已排'
# self.env['sale.order'].browse(record.production_id.origin).schedule_status = 'to process'
sale_obj = self.env['sale.order'].search([('name', '=', record.origin)])
if 'S' in sale_obj.name:
@@ -202,7 +203,7 @@ class sf_production_plan(models.Model):
mrp_production_ids = record.production_id._get_children().ids
print('mrp_production_ids', mrp_production_ids)
for i in mrp_production_ids:
record.env['mrp.production'].browse(i).schedule_state = '已排'
record.env['mrp.production'].sudo().browse(i).schedule_state = '已排'
# record.production_id.date_planned_start = record.date_planned_start
# record.production_id.date_planned_finished = record.date_planned_finished
else: