Merge branch 'feature/修复工单cnc校验bug' into feature/修复工单cnc校验bug_1
# Conflicts: # sf_tool_management/models/mrp_workorder.py
This commit is contained in:
@@ -827,6 +827,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
# workorder.state = 'waiting'
|
||||
# if workorder.routing_type == 'CNC加工' and workorder.state == 'progress':
|
||||
# workorder.state = 'to be detected'
|
||||
|
||||
# for workorder in self:
|
||||
# if workorder.is_rework is True and workorder.state == 'done':
|
||||
# cnc_work = self.env['mrp.workorder'].search([('routing_type','=','CNC加工'),('production_id','=',workorder.production_id.id)])
|
||||
@@ -865,12 +866,10 @@ class ResMrpWorkOrder(models.Model):
|
||||
limit=1, order='id asc')
|
||||
if not cnc_workorder.cnc_ids:
|
||||
raise UserError(_('该制造订单还未下发CNC程序,请稍后再试'))
|
||||
# else:
|
||||
# for item in cnc_workorder.cnc_ids:
|
||||
# functional_cutting_tool = self.env['sf.functional.cutting.tool.entity'].search(
|
||||
# [('tool_name_id.name', '=', item.cutting_tool_name)])
|
||||
# if not functional_cutting_tool:
|
||||
# raise UserError(_('该制造订单的CNC程序为%s没有对应的功能刀具' % item.cutting_tool_name))
|
||||
else:
|
||||
if self.production_id.tool_state in ['1', '2']:
|
||||
raise UserError(
|
||||
f'制造订单【{self.production_id.name}】功能刀具状态为【{self.production_id.tool_state}】!')
|
||||
if self.routing_type == '解除装夹':
|
||||
'''
|
||||
记录开始时间
|
||||
|
||||
Reference in New Issue
Block a user