Merge branch 'feature/修复工单cnc校验bug_2' into feature/修复工单cnc校验bug_3
# Conflicts: # sf_manufacturing/models/mrp_workorder.py
This commit is contained in:
@@ -824,11 +824,17 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
('state', 'in', ['done'])])
|
('state', 'in', ['done'])])
|
||||||
if unclamp_workorder:
|
if unclamp_workorder:
|
||||||
workorder.state = 'ready'
|
workorder.state = 'ready'
|
||||||
logging.info('工序:%s' % workorder.sequence)
|
|
||||||
logging.info('工单最终状态:%s' % workorder.state)
|
|
||||||
# else:
|
# else:
|
||||||
# if workorder.state not in ['cancel', 'rework']:
|
# if workorder.state not in ['cancel', 'rework']:
|
||||||
# workorder.state = 'rework'
|
# workorder.state = 'rework'
|
||||||
|
if workorder.production_id.state == 'pending_cam':
|
||||||
|
if workorder.routing_type == '装夹预调' and workorder.state in ['ready', 'waiting']:
|
||||||
|
if workorder.production_id.tool_state in ['1', '2']:
|
||||||
|
workorder.state = 'waiting'
|
||||||
|
|
||||||
|
logging.info('工序:%s' % workorder.sequence)
|
||||||
|
logging.info('工单最终状态:%s' % workorder.state)
|
||||||
|
|
||||||
# elif workorder.routing_type == 'CNC加工' and workorder.state not in ['done', 'cancel', 'progress',
|
# elif workorder.routing_type == 'CNC加工' and workorder.state not in ['done', 'cancel', 'progress',
|
||||||
# 'rework']:
|
# 'rework']:
|
||||||
# per_work = self.env['mrp.workorder'].search(
|
# per_work = self.env['mrp.workorder'].search(
|
||||||
@@ -879,8 +885,12 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
raise UserError(_('该制造订单还未下发CNC程序,请稍后再试'))
|
raise UserError(_('该制造订单还未下发CNC程序,请稍后再试'))
|
||||||
else:
|
else:
|
||||||
if self.production_id.tool_state in ['1', '2']:
|
if self.production_id.tool_state in ['1', '2']:
|
||||||
|
if self.production_id.tool_state == '1':
|
||||||
|
state = '缺刀'
|
||||||
|
else:
|
||||||
|
state = '无效刀'
|
||||||
raise UserError(
|
raise UserError(
|
||||||
f'制造订单【{self.production_id.name}】功能刀具状态为【{self.production_id.tool_state}】!')
|
f'制造订单【{self.production_id.name}】功能刀具状态为【{state}】!')
|
||||||
if self.routing_type == '解除装夹':
|
if self.routing_type == '解除装夹':
|
||||||
'''
|
'''
|
||||||
记录开始时间
|
记录开始时间
|
||||||
|
|||||||
Reference in New Issue
Block a user