cnc工单和解除装夹工单隐藏【工序状态】字段,装夹预调工单已完成后【工序状态】字段显示“装夹预调完成”

This commit is contained in:
mgw
2024-05-18 19:52:27 +08:00
parent 9284701ed4
commit 6f3d423da1
2 changed files with 4 additions and 4 deletions

View File

@@ -154,10 +154,10 @@ class ResMrpWorkOrder(models.Model):
process_state = fields.Selection([ process_state = fields.Selection([
('待装夹', '待装夹'), ('待装夹', '待装夹'),
('待检测', '待检测'), ('待检测', '待检测'),
('待加工', '待加'), ('待加工', '装夹预调完'),
('待解除装夹', '待解除装夹'), ('待解除装夹', '待解除装夹'),
('已完工', '已完工'), ('已完工', '已完工'),
], string='工序状态', default='待装夹') ], string='工序状态', default='待装夹', readonly='True')
# 加工图纸 # 加工图纸
processing_drawing = fields.Binary(string='加工图纸', related='production_id.part_drawing') processing_drawing = fields.Binary(string='加工图纸', related='production_id.part_drawing')
@@ -841,7 +841,7 @@ class ResMrpWorkOrder(models.Model):
raise UserError("请对前置三元检测定位参数进行计算定位") raise UserError("请对前置三元检测定位参数进行计算定位")
if not record.rfid_code: if not record.rfid_code:
raise UserError("请扫RFID码进行绑定") raise UserError("请扫RFID码进行绑定")
record.process_state = '待加工' record.process_state = '装夹预调完成'
# record.write({'process_state': '待加工'}) # record.write({'process_state': '待加工'})
record.production_id.process_state = '待加工' record.production_id.process_state = '待加工'
if record.routing_type == 'CNC加工': if record.routing_type == 'CNC加工':

View File

@@ -171,7 +171,7 @@
</xpath> </xpath>
<xpath expr="//label[1]" position="before"> <xpath expr="//label[1]" position="before">
<field name='routing_type'/> <field name='routing_type'/>
<field name='process_state'/> <field name='process_state' attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
</xpath> </xpath>
<xpath expr="//label[1]" position="attributes"> <xpath expr="//label[1]" position="attributes">
<attribute name="string">计划加工时间</attribute> <attribute name="string">计划加工时间</attribute>