Merge branch 'feature/修复返工bug' into develop
This commit is contained in:
@@ -761,6 +761,10 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
[('production_id', '=', workorder.production_id.id),
|
[('production_id', '=', workorder.production_id.id),
|
||||||
('processing_panel', '=', workorder.processing_panel),
|
('processing_panel', '=', workorder.processing_panel),
|
||||||
('routing_type', '=', 'CNC加工'), ('state', 'in', ['pending'])])
|
('routing_type', '=', 'CNC加工'), ('state', 'in', ['pending'])])
|
||||||
|
unclamp_workorder = self.env['mrp.workorder'].search(
|
||||||
|
[('production_id', '=', workorder.production_id.id),
|
||||||
|
('sequence', '=', workorder.sequence - 1),
|
||||||
|
('state', 'in', ['done'])])
|
||||||
if workorder.state not in ['cancel', 'progress', 'rework']:
|
if workorder.state not in ['cancel', 'progress', 'rework']:
|
||||||
if workorder.production_id.state == 'rework':
|
if workorder.production_id.state == 'rework':
|
||||||
logging.info('len(re_work):%s' % len(re_work))
|
logging.info('len(re_work):%s' % len(re_work))
|
||||||
@@ -819,13 +823,12 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
workorder.is_rework is False and workorder.state not in [
|
workorder.is_rework is False and workorder.state not in [
|
||||||
'done', 'rework',
|
'done', 'rework',
|
||||||
'cancel']:
|
'cancel']:
|
||||||
if (re_work or cnc_workorder) and workorder.production_id.is_rework is False:
|
if workorder.production_id.is_rework is False:
|
||||||
workorder.state = 'ready'
|
if re_work or cnc_workorder or unclamp_workorder:
|
||||||
|
workorder.state = 'ready'
|
||||||
|
# if (re_work or cnc_workorder) and workorder.production_id.is_rework is False:
|
||||||
|
# workorder.state = 'ready'
|
||||||
if workorder.routing_type == '表面工艺' and workorder.state not in ['done', 'progress']:
|
if workorder.routing_type == '表面工艺' and workorder.state not in ['done', 'progress']:
|
||||||
unclamp_workorder = self.env['mrp.workorder'].search(
|
|
||||||
[('production_id', '=', workorder.production_id.id),
|
|
||||||
('sequence', '=', workorder.sequence - 1),
|
|
||||||
('state', 'in', ['done'])])
|
|
||||||
if unclamp_workorder:
|
if unclamp_workorder:
|
||||||
workorder.state = 'ready'
|
workorder.state = 'ready'
|
||||||
# else:
|
# else:
|
||||||
@@ -835,7 +838,6 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
if workorder.routing_type == '装夹预调' and workorder.state in ['ready', 'waiting']:
|
if workorder.routing_type == '装夹预调' and workorder.state in ['ready', 'waiting']:
|
||||||
if workorder.production_id.tool_state in ['1', '2']:
|
if workorder.production_id.tool_state in ['1', '2']:
|
||||||
workorder.state = 'waiting'
|
workorder.state = 'waiting'
|
||||||
|
|
||||||
logging.info('工序:%s' % workorder.sequence)
|
logging.info('工序:%s' % workorder.sequence)
|
||||||
logging.info('工单最终状态:%s' % workorder.state)
|
logging.info('工单最终状态:%s' % workorder.state)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user