From a1bf997d516b88e12e30d350310aca9e4669e932 Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Thu, 2 Jan 2025 12:49:05 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=B2=97=E4=B8=8E?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=80=BB=E7=9B=91=E5=B2=97=E4=BD=8D=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=B7=A5=E5=8D=95=E6=93=8D=E4=BD=9C=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/security/ir.model.access.csv | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sf_manufacturing/security/ir.model.access.csv b/sf_manufacturing/security/ir.model.access.csv index f096b449..b8862b8d 100644 --- a/sf_manufacturing/security/ir.model.access.csv +++ b/sf_manufacturing/security/ir.model.access.csv @@ -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 \ No newline at end of file +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 \ No newline at end of file From 0ce51a4a66a320191c1ed81e3e7082dc52231d5a Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Thu, 2 Jan 2025 12:49:46 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=BA=E5=B7=A5?= =?UTF-8?q?=E7=BA=BF=E4=B8=8B=E5=8A=A0=E5=B7=A5=E5=B7=A5=E5=8D=95=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 2 + .../production_technology_re_adjust_wizard.py | 49 ------------------- .../wizard/production_technology_wizard.py | 30 ------------ 3 files changed, 2 insertions(+), 79 deletions(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 057530d0..af0f0aa9 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -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')) diff --git a/sf_manufacturing/wizard/production_technology_re_adjust_wizard.py b/sf_manufacturing/wizard/production_technology_re_adjust_wizard.py index 5bd32b8c..fe90f66a 100644 --- a/sf_manufacturing/wizard/production_technology_re_adjust_wizard.py +++ b/sf_manufacturing/wizard/production_technology_re_adjust_wizard.py @@ -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')]) diff --git a/sf_manufacturing/wizard/production_technology_wizard.py b/sf_manufacturing/wizard/production_technology_wizard.py index 1feee749..0415d1fd 100644 --- a/sf_manufacturing/wizard/production_technology_wizard.py +++ b/sf_manufacturing/wizard/production_technology_wizard.py @@ -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), From 2f3e12e3af4bd9b123bc73b537b65e2e8bec30fb Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Thu, 2 Jan 2025 12:50:39 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=A1=A8=E9=9D=A2=E5=B7=A5=E8=89=BA?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=8D=95=E7=A1=AE=E8=AE=A4=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E9=99=90=E5=88=B6=EF=BC=8C=E8=87=AA=E5=8A=A8=E5=8C=96=E4=BA=A7?= =?UTF-8?q?=E7=BA=BF=E5=8A=A0=E5=B7=A5=E8=B7=AF=E7=BA=BF=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E7=9F=AB=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_sale/models/sale_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sf_sale/models/sale_order.py b/sf_sale/models/sale_order.py index 95999611..b03d761a 100644 --- a/sf_sale/models/sale_order.py +++ b/sf_sale/models/sale_order.py @@ -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('等待组件')