No quality check found
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/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
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),
diff --git a/sf_message/__manifest__.py b/sf_message/__manifest__.py
index 6796a50b..8c769d60 100644
--- a/sf_message/__manifest__.py
+++ b/sf_message/__manifest__.py
@@ -12,7 +12,7 @@
'category': 'sf',
'website': 'https://www.sf.jikimo.com',
'depends': ['sale', 'purchase', 'sf_plan', 'jikimo_message_notify', 'stock', 'sf_quality', 'mrp',
- 'sf_manufacturing','product'],
+ 'sf_manufacturing','product','quality'],
'data': [
'data/bussiness_node.xml',
'data/cron_data.xml',
diff --git a/sf_message/data/bussiness_node.xml b/sf_message/data/bussiness_node.xml
index e7c3b0ba..b429d766 100644
--- a/sf_message/data/bussiness_node.xml
+++ b/sf_message/data/bussiness_node.xml
@@ -150,5 +150,10 @@