1、制造订单状态优化
This commit is contained in:
@@ -311,13 +311,6 @@ class MrpProduction(models.Model):
|
|||||||
elif production.state == 'cancel' or (production.move_finished_ids and all(
|
elif production.state == 'cancel' or (production.move_finished_ids and all(
|
||||||
move.state == 'cancel' for move in production.move_finished_ids)):
|
move.state == 'cancel' for move in production.move_finished_ids)):
|
||||||
production.state = 'cancel'
|
production.state = 'cancel'
|
||||||
elif (
|
|
||||||
production.state == 'done'
|
|
||||||
or (production.move_raw_ids and all(
|
|
||||||
move.state in ('cancel', 'done') for move in production.move_raw_ids))
|
|
||||||
and all(move.state in ('cancel', 'done') for move in production.move_finished_ids)
|
|
||||||
):
|
|
||||||
production.state = 'done'
|
|
||||||
elif production.workorder_ids and all(
|
elif production.workorder_ids and all(
|
||||||
wo_state in ('done', 'cancel') for wo_state in production.workorder_ids.mapped('state')):
|
wo_state in ('done', 'cancel') for wo_state in production.workorder_ids.mapped('state')):
|
||||||
production.state = 'to_close'
|
production.state = 'to_close'
|
||||||
@@ -351,18 +344,9 @@ class MrpProduction(models.Model):
|
|||||||
production.state = 'technology_to_confirmed'
|
production.state = 'technology_to_confirmed'
|
||||||
if production.state == 'confirmed' and production.schedule_state == '已排':
|
if production.state == 'confirmed' and production.schedule_state == '已排':
|
||||||
production.state = 'pending_cam'
|
production.state = 'pending_cam'
|
||||||
if production.state == 'progress':
|
|
||||||
if all(wo_state not in ('progress', 'done', 'rework', 'scrap') for wo_state in
|
|
||||||
production.workorder_ids.mapped('state')):
|
|
||||||
production.state = 'pending_cam'
|
|
||||||
if production.is_rework is True:
|
|
||||||
production.state = 'rework'
|
|
||||||
if (production.state == 'rework' and production.tool_state == '0'
|
if (production.state == 'rework' and production.tool_state == '0'
|
||||||
and production.schedule_state == '已排' and production.is_rework is False):
|
and production.schedule_state == '已排' and production.is_rework is False):
|
||||||
production.state = 'pending_cam'
|
production.state = 'pending_cam'
|
||||||
# if production.state == 'pending_cam':
|
|
||||||
# if all(wo_state in 'done' for wo_state in production.workorder_ids.mapped('state')):
|
|
||||||
# production.state = 'done'
|
|
||||||
if any((wo.test_results == '返工' and wo.state == 'done' and
|
if any((wo.test_results == '返工' and wo.state == 'done' and
|
||||||
(production.programming_state in ['已编程'] or wo.individuation_page_PTD is True))
|
(production.programming_state in ['已编程'] or wo.individuation_page_PTD is True))
|
||||||
or (wo.is_rework is True and wo.state == 'done' and production.programming_state in ['编程中', '已编程'])
|
or (wo.is_rework is True and wo.state == 'done' and production.programming_state in ['编程中', '已编程'])
|
||||||
@@ -377,6 +361,8 @@ class MrpProduction(models.Model):
|
|||||||
wo_state in ('done', 'rework', 'cancel') for wo_state in production.workorder_ids.mapped('state')):
|
wo_state in ('done', 'rework', 'cancel') for wo_state in production.workorder_ids.mapped('state')):
|
||||||
if production.state not in ['scrap', 'rework', 'cancel']:
|
if production.state not in ['scrap', 'rework', 'cancel']:
|
||||||
production.state = 'done'
|
production.state = 'done'
|
||||||
|
elif production.state == 'done':
|
||||||
|
production.state = 'progress'
|
||||||
|
|
||||||
# 退回调整
|
# 退回调整
|
||||||
def technology_back_adjust(self):
|
def technology_back_adjust(self):
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ class ReworkWizard(models.TransientModel):
|
|||||||
break
|
break
|
||||||
for p in production_id.detection_result_ids.filtered(
|
for p in production_id.detection_result_ids.filtered(
|
||||||
lambda ap1: ap1.handle_result == '待处理'):
|
lambda ap1: ap1.handle_result == '待处理'):
|
||||||
if p.processing_panel and p.processing_panel not in panel_arr:
|
if p.processing_panel is not False and p.processing_panel not in panel_arr:
|
||||||
panel_arr += ','.join(p.processing_panel)
|
panel_arr += ','.join(p.processing_panel)
|
||||||
for item in panel_arr.split(','):
|
for item in panel_arr.split(','):
|
||||||
panel = self.env['sf.processing.panel'].search(
|
panel = self.env['sf.processing.panel'].search(
|
||||||
|
|||||||
Reference in New Issue
Block a user