1、当检测到缺刀工单需要的功能刀具从刀具房出库到线边刀架时,更改cnc编程单的功能刀具状态为正常;
This commit is contained in:
@@ -32,9 +32,9 @@ class MrpProduction(models.Model):
|
||||
def _compute_tool_state(self):
|
||||
for item in self:
|
||||
if item:
|
||||
if item.workorder_ids.filtered(lambda a: a.tool_state == '2'):
|
||||
if item.workorder_ids.filtered(lambda a: a.tool_state == '2' and a.state not in ('rework', '返工')):
|
||||
item.tool_state = '2'
|
||||
elif item.workorder_ids.filtered(lambda a: a.tool_state == '1'):
|
||||
elif item.workorder_ids.filtered(lambda a: a.tool_state == '1' and a.state not in ('rework', '返工')):
|
||||
item.tool_state = '1'
|
||||
else:
|
||||
item.tool_state = '0'
|
||||
|
||||
@@ -1135,6 +1135,8 @@ class CNCprocessing(models.Model):
|
||||
program_path = fields.Char('程序文件路径')
|
||||
program_create_date = fields.Datetime('程序创建日期')
|
||||
|
||||
tool_state = fields.Selection([('0', '正常'), ('1', '缺刀'), ('2', '无效刀')], string='刀具状态', default='0')
|
||||
|
||||
# mrs下发编程单创建CNC加工
|
||||
def cnc_processing_create(self, cnc_workorder, ret, program_path, program_path_tmp):
|
||||
cnc_processing = None
|
||||
|
||||
Reference in New Issue
Block a user