Accept Merge Request #1702: (feature/part_number -> develop)
Merge Request: 表面工艺采购单确认订单限制,自动化产线加工路线逻辑矫正 Created By: @廖丹龙 Reviewed By: @胡尧 Approved By: @胡尧 Accepted By: @廖丹龙 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1702
This commit is contained in:
@@ -941,6 +941,8 @@ class MrpProduction(models.Model):
|
||||
and item.process_parameters_id == work.surface_technics_parameters_id) or
|
||||
(item.route_id.name == work.name and item.panel
|
||||
and item.panel == work.processing_panel))
|
||||
if work.name == '人工线下加工':
|
||||
td_ids = technology_design_ids.filtered(lambda item: (item.route_id.name in work.name))
|
||||
if td_ids:
|
||||
work.sequence = td_ids[0].sequence
|
||||
cancel_work_ids = workorder_ids.filtered(lambda item: item.state in ('已取消', 'cancel'))
|
||||
|
||||
@@ -183,4 +183,7 @@ access_sf_manual_product_model_type_routing_sort_manager,sf_manual_product_model
|
||||
access_sf_manual_product_model_type_routing_sort_group_plan_dispatch,sf_manual_product_model_type_routing_sort_group_plan_dispatch,model_sf_manual_product_model_type_routing_sort,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_sf_detection_result_manager,sf_detection_result_manager,model_sf_detection_result,,1,1,1,1
|
||||
|
||||
access_mrp_workorder_batch_replan_wizard_group_plan_dispatch,mrp_workorder_batch_replan_wizard_group_plan_dispatch,model_mrp_workorder_batch_replan_wizard,sf_base.group_plan_dispatch,1,1,1,0
|
||||
access_mrp_workorder_batch_replan_wizard_group_plan_dispatch,mrp_workorder_batch_replan_wizard_group_plan_dispatch,model_mrp_workorder_batch_replan_wizard,sf_base.group_plan_dispatch,1,1,1,0
|
||||
|
||||
access_mrp_workorder_group_purchase_director,mrp_workorder,model_mrp_workorder,sf_base.group_purchase_director,1,1,0,0
|
||||
access_mrp_workorder_group_purchase,mrp_workorder,model_mrp_workorder,sf_base.group_purchase,1,1,0,0
|
||||
|
@@ -25,38 +25,6 @@ class ProductionTechnologyReAdjustWizard(models.TransientModel):
|
||||
# 该制造订单的其他同一销售订单的制造订单的工艺设计处理
|
||||
if production_item != self.production_id:
|
||||
self.env['sf.technology.design'].sudo().unified_procedure_multiple_work_orders(technology_designs, production_item)
|
||||
# for td_other in production_item.technology_design_ids:
|
||||
# # if td_other.is_auto is False:
|
||||
# # td_del = technology_designs.filtered(lambda tdo: tdo.route_id.id == td_other.route_id.id)
|
||||
# # if not td_del or td_del.active is False:
|
||||
# # td_other.write({'active': False})
|
||||
# for td_main in technology_designs:
|
||||
# route_other = production_item.technology_design_ids.filtered(
|
||||
# lambda td: td.route_id.id == td_main.route_id.id)
|
||||
# if not route_other and td_main.active is True:
|
||||
# production_item.write({'technology_design_ids': [(0, 0, {
|
||||
# 'route_id': td_main.route_id.id,
|
||||
# 'process_parameters_id': False if td_main.process_parameters_id is False else
|
||||
# self.env[
|
||||
# 'sf.production.process.parameter'].search(
|
||||
# [('id', '=', td_main.process_parameters_id.id)]).id,
|
||||
# 'sequence': td_main.sequence,
|
||||
# 'is_auto': td_main.is_auto})]})
|
||||
# else:
|
||||
# for ro in route_other:
|
||||
# domain = [('production_id', '=', self.production_id.id),
|
||||
# ('active', 'in', [True, False]),
|
||||
# ('route_id', '=', ro.route_id.id)]
|
||||
# if ro.route_id.routing_type == '表面工艺':
|
||||
# domain += [('process_parameters_id', '=', ro.process_parameters_id.id)]
|
||||
# elif ro.route_id.routing_tag == 'special' and ro.is_auto is False:
|
||||
# # display_name = ro.route_id.display_name
|
||||
# domain += [('id', '=', ro.id)]
|
||||
# elif ro.panel is not False:
|
||||
# domain += [('panel', '=', ro.panel)]
|
||||
# td_upd = self.env['sf.technology.design'].sudo().search(domain)
|
||||
# if td_upd:
|
||||
# ro.write({'sequence': td_upd.sequence, 'active': td_upd.active})
|
||||
special_design = self.env['sf.technology.design'].sudo().search(
|
||||
[('routing_tag', '=', 'special'), ('production_id', '=', production_item.id),
|
||||
('is_auto', '=', False), ('active', 'in', [True, False])])
|
||||
@@ -71,23 +39,6 @@ class ProductionTechnologyReAdjustWizard(models.TransientModel):
|
||||
else:
|
||||
domain += [('technology_design_id', '=', special.id), ('state', '!=', 'cancel')]
|
||||
workorder = self.env['mrp.workorder'].search(domain)
|
||||
# previous_workorder = self.env['mrp.workorder'].search(
|
||||
# [('sequence', '=', workorder.sequence - 1), ('routing_type', '=', '表面工艺'),
|
||||
# ('production_id', '=', workorder.production_id.id)])
|
||||
# if previous_workorder:
|
||||
# if previous_workorder.supplier_id != workorder.supplier_id:
|
||||
# is_cancel = True
|
||||
# else:
|
||||
# is_cancel = True
|
||||
# if workorder.state != 'cancel' and is_cancel is True:
|
||||
# workorder.write({'state': 'cancel'})
|
||||
# workorder.picking_ids.write({'state': 'cancel'})
|
||||
# workorder.picking_ids.move_ids.write({'state': 'cancel'})
|
||||
# purchase_order = self.env['purchase.order'].search(
|
||||
# [('origin', '=', workorder.production_id.name)])
|
||||
# for line in purchase_order.order_line:
|
||||
# if line.product_id.server_product_process_parameters_id == workorder.surface_technics_parameters_id:
|
||||
# purchase_order.write({'state': 'cancel'})
|
||||
else:
|
||||
workorder = self.env['mrp.workorder'].search(
|
||||
[('technology_design_id', '=', special.id), ('production_id', '=', special.production_id.id), ('state', '!=', 'cancel')])
|
||||
|
||||
@@ -27,36 +27,6 @@ class ProductionTechnologyWizard(models.TransientModel):
|
||||
if production != self.production_id:
|
||||
self.env['sf.technology.design'].sudo().unified_procedure_multiple_work_orders(technology_designs,
|
||||
production)
|
||||
# for td_other in production.technology_design_ids:
|
||||
# if td_other.is_auto is False:
|
||||
# td_del = technology_designs.filtered(lambda tdo: tdo.route_id.id == td_other.route_id.id)
|
||||
# if not td_del or td_del.active is False:
|
||||
# td_other.write({'active': False})
|
||||
# for td_main in technology_designs:
|
||||
# route_other = production.technology_design_ids.filtered(
|
||||
# lambda td: td.route_id.id == td_main.route_id.id)
|
||||
# if not route_other and td_main.active is True:
|
||||
# production.write({'technology_design_ids': [(0, 0, {
|
||||
# 'route_id': td_main.route_id.id,
|
||||
# 'process_parameters_id': False if td_main.process_parameters_id is False else self.env[
|
||||
# 'sf.production.process.parameter'].search(
|
||||
# [('id', '=', td_main.process_parameters_id.id)]).id,
|
||||
# 'sequence': td_main.sequence})]})
|
||||
# else:
|
||||
# for ro in route_other:
|
||||
# domain = [('production_id', '=', self.production_id.id),
|
||||
# ('active', 'in', [True, False]),
|
||||
# ('route_id', '=', ro.route_id.id)]
|
||||
# if ro.route_id.routing_type == '表面工艺':
|
||||
# domain += [('process_parameters_id', '=', ro.process_parameters_id.id)]
|
||||
# elif ro.route_id.routing_tag == 'special' and ro.is_auto is False:
|
||||
# # display_name = ro.route_id.display_name
|
||||
# domain += [('id', '=', ro.id)]
|
||||
# elif ro.panel is not False:
|
||||
# domain += [('panel', '=', ro.panel)]
|
||||
# td_upd = self.env['sf.technology.design'].sudo().search(domain)
|
||||
# if td_upd:
|
||||
# ro.write({'sequence': td_upd.sequence, 'active': td_upd.active})
|
||||
# 特殊表面工艺
|
||||
special_design = self.env['sf.technology.design'].sudo().search(
|
||||
[('routing_tag', '=', 'special'), ('production_id', '=', production.id),
|
||||
|
||||
@@ -401,7 +401,7 @@ class RePurchaseOrder(models.Model):
|
||||
artificial_offline = (
|
||||
workorder.production_id.production_type == '人工线下加工' and workorder.production_id.schedule_state != '已排')
|
||||
auto_production = (
|
||||
workorder.production_id.production_type == '自动化产线加工' and workorder.production_id.schedule_state != '已编程')
|
||||
workorder.production_id.production_type == '自动化产线加工' and workorder.production_id.programming_state != '已编程')
|
||||
if workorder.sequence == min_sequence_wk.sequence:
|
||||
if artificial_offline or auto_production:
|
||||
raise UserError('等待组件')
|
||||
|
||||
Reference in New Issue
Block a user