1、解决 缺刀状态第一张工单状态不对 bug
This commit is contained in:
@@ -820,6 +820,10 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
# 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'
|
||||||
# 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(
|
||||||
@@ -870,8 +874,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