diff --git a/jikimo_sale_multiple_supply_methods/__init__.py b/jikimo_sale_multiple_supply_methods/__init__.py index a1ff64da..62b89387 100644 --- a/jikimo_sale_multiple_supply_methods/__init__.py +++ b/jikimo_sale_multiple_supply_methods/__init__.py @@ -7,11 +7,11 @@ from odoo import api, SUPERUSER_ID def _data_install(cr, registry): env = api.Environment(cr, SUPERUSER_ID, {}) # 获取所有需要设置的产品模板 - env.ref('jikimo_sale_multiple_supply_methods.product_template_purchase').product_variant_id.write({'active': False}) - env.ref('jikimo_sale_multiple_supply_methods.product_template_manual_processing').product_variant_id.write({'active': False, 'single_manufacturing': True}) - env.ref('jikimo_sale_multiple_supply_methods.product_template_default').product_variant_id.write({'active': False}) + env.ref('jikimo_sale_multiple_supply_methods.product_template_purchase').product_variant_id.write({'active': False, 'is_bfm': True}) + env.ref('jikimo_sale_multiple_supply_methods.product_template_manual_processing').product_variant_id.write({'active': False, 'single_manufacturing': True, 'is_bfm': True}) + env.ref('jikimo_sale_multiple_supply_methods.product_template_default').product_variant_id.write({'active': False, 'is_bfm': True}) env.ref('jikimo_sale_multiple_supply_methods.product_template_raw_material_customer_provided').product_variant_id.write({'active': False}) - env.ref('jikimo_sale_multiple_supply_methods.product_template_outsourcing').product_variant_id.write({'active': False}) + env.ref('jikimo_sale_multiple_supply_methods.product_template_outsourcing').product_variant_id.write({'active': False, 'is_bfm': True}) env.ref('sf_dlm.product_embryo_sf_self_machining').product_tmpl_id.write({'categ_type': '坯料'}) env.ref('sf_dlm.product_template_sf').product_tmpl_id.write({'categ_type': '成品'}) env.ref('sf_dlm.product_embryo_sf_outsource').product_tmpl_id.write({'categ_type': '坯料'}) diff --git a/jikimo_sale_multiple_supply_methods/data/product_data.xml b/jikimo_sale_multiple_supply_methods/data/product_data.xml index d0921f78..2a74b3bb 100644 --- a/jikimo_sale_multiple_supply_methods/data/product_data.xml +++ b/jikimo_sale_multiple_supply_methods/data/product_data.xml @@ -15,7 +15,6 @@ true serial - true 成品 true @@ -32,7 +31,6 @@ 成品 - true @@ -47,7 +45,6 @@ 成品 - true @@ -61,7 +58,6 @@ 成品 - true diff --git a/sf_manufacturing/__manifest__.py b/sf_manufacturing/__manifest__.py index 98c71f21..3320f943 100644 --- a/sf_manufacturing/__manifest__.py +++ b/sf_manufacturing/__manifest__.py @@ -10,7 +10,7 @@ """, 'category': 'sf', 'website': 'https://www.sf.jikimo.com', - 'depends': ['sf_base', 'sf_maintenance', 'web_widget_model_viewer', 'sf_warehouse','jikimo_attachment_viewer', 'jikimo_sale_multiple_supply_methods'], + 'depends': ['sf_base', 'sf_maintenance', 'web_widget_model_viewer', 'sf_warehouse','jikimo_attachment_viewer'], 'data': [ 'data/stock_data.xml', 'data/empty_racks_data.xml', diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 40239012..13be15e3 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -1300,17 +1300,17 @@ class MrpProduction(models.Model): return production_values_str # 增加制造订单类型 - production_type = fields.Selection( - [('自动化产线加工', '自动化产线加工'), ('人工线下加工', '人工线下加工')], - string='制造类型', - compute='_compute_production_type', - store=True - ) + # production_type = fields.Selection( + # [('自动化产线加工', '自动化产线加工'), ('人工线下加工', '人工线下加工')], + # string='制造类型', + # compute='_compute_production_type', + # store=True + # ) - @api.depends('product_id.is_manual_processing') - def _compute_production_type(self): - for production in self: - production.production_type = '自动化产线加工' if not production.product_id.is_manual_processing else '人工线下加工' + # @api.depends('product_id.is_manual_processing') + # def _compute_production_type(self): + # for production in self: + # production.production_type = '自动化产线加工' if not production.product_id.is_manual_processing else '人工线下加工' class sf_detection_result(models.Model): diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 022b4b2e..baf0c1b5 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -934,6 +934,7 @@ class ResProductMo(models.Model): # if surface_technology: # no_bom_copy_product_id.route_ids |= surface_technology no_bom_copy_product_id.product_tmpl_id.active = True + logging.info('no_bom_copy_product_id[is_manual_processing]:%s' % no_bom_copy_product_id.is_manual_processing) materials_id = self.env['sf.production.materials'].search( [('materials_no', '=', item['texture_code'])]) materials_type_id = self.env['sf.materials.model'].search( @@ -959,7 +960,7 @@ class ResProductMo(models.Model): 'materials_type_id': materials_type_id.id, 'single_manufacturing': product_id.single_manufacturing, 'is_bfm': True, - 'active': True + 'active': True, } # 外协和采购生成的坯料需要根据材料型号绑定供应商 if route_type == 'subcontract' or route_type == 'purchase': diff --git a/sf_manufacturing/views/mrp_production_addional_change.xml b/sf_manufacturing/views/mrp_production_addional_change.xml index c218c2d5..ee52cb3e 100644 --- a/sf_manufacturing/views/mrp_production_addional_change.xml +++ b/sf_manufacturing/views/mrp_production_addional_change.xml @@ -35,10 +35,10 @@ - + @@ -91,7 +91,7 @@ - + - +