Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修复工件配送目的生产线

This commit is contained in:
jinling.yang
2024-07-25 15:41:01 +08:00
4 changed files with 23 additions and 9 deletions

View File

@@ -828,11 +828,17 @@ class ResMrpWorkOrder(models.Model):
('state', 'in', ['done'])])
if unclamp_workorder:
workorder.state = 'ready'
# else:
# if workorder.state not in ['cancel', '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)
# else:
# if workorder.state not in ['cancel', 'rework']:
# workorder.state = 'rework'
# elif workorder.routing_type == 'CNC加工' and workorder.state not in ['done', 'cancel', 'progress',
# 'rework']:
# per_work = self.env['mrp.workorder'].search(
@@ -883,8 +889,12 @@ class ResMrpWorkOrder(models.Model):
raise UserError(_('该制造订单还未下发CNC程序请稍后再试'))
else:
if self.production_id.tool_state in ['1', '2']:
if self.production_id.tool_state == '1':
state = '缺刀'
else:
state = '无效刀'
raise UserError(
f'制造订单【{self.production_id.name}】功能刀具状态为【{self.production_id.tool_state}】!')
f'制造订单【{self.production_id.name}】功能刀具状态为【{state}】!')
if self.routing_type == '解除装夹':
'''
记录开始时间