diff --git a/jikimo_sale_multiple_supply_methods/__manifest__.py b/jikimo_sale_multiple_supply_methods/__manifest__.py index a7d39ac7..7a361bdd 100644 --- a/jikimo_sale_multiple_supply_methods/__manifest__.py +++ b/jikimo_sale_multiple_supply_methods/__manifest__.py @@ -12,7 +12,7 @@ 'data/stock_routes.xml', 'data/product_data.xml', 'views/sale_order_views.xml', - # 'views/product_product_views.xml', + 'views/product_product_views.xml', ],'assets': { # 'web.assets_backend': [ # 'jikimo_sale_multiple_supply_methods/static/src/**/*' diff --git a/jikimo_sale_multiple_supply_methods/models/sale_order.py b/jikimo_sale_multiple_supply_methods/models/sale_order.py index 27cecac6..cd8fa749 100644 --- a/jikimo_sale_multiple_supply_methods/models/sale_order.py +++ b/jikimo_sale_multiple_supply_methods/models/sale_order.py @@ -55,6 +55,8 @@ class SaleOrder(models.Model): 'model_height': product.height, 'price': product.list_price, } + # 获取成品名结尾-n的n + product_seria = int(product.name.split('-')[-1]) # 成品供货方式为采购则不生成bom if line.supply_method != 'purchase': bom_data = self.env['mrp.bom'].with_user(self.env.ref("base.user_admin")).get_bom(product) @@ -71,7 +73,7 @@ class SaleOrder(models.Model): material_customer_provided_embryo = self.env['product.template'].sudo().no_bom_product_create( customer_provided_embryo.with_context(active_test=False).product_variant_id, item, - order_id, 'material_customer_provided', 0, product) + order_id, 'material_customer_provided', product_seria, product) # 成品配置bom product_bom_material_customer_provided = self.env['mrp.bom'].with_user( self.env.ref("base.user_admin")).bom_create( @@ -84,7 +86,7 @@ class SaleOrder(models.Model): self_machining_embryo = self.env['product.template'].sudo().no_bom_product_create( self_machining_id, item, - order_id, 'self_machining', 0, product) + order_id, 'self_machining', product_seria, product) # 创建坯料的bom self_machining_bom = self.env['mrp.bom'].with_user( self.env.ref("base.user_admin")).bom_create( @@ -108,7 +110,7 @@ class SaleOrder(models.Model): item, order_id, 'subcontract', - 0, product) + product_seria, product) if outsource_embryo == -3: raise UserError('该订单模型的材料型号暂未设置获取方式和供应商,请先配置再进行分配') # 创建坯料的bom @@ -130,7 +132,7 @@ class SaleOrder(models.Model): purchase_embryo = self.env['product.template'].sudo().no_bom_product_create(purchase_id, item, order_id, - 'purchase', 0, + 'purchase', product_seria, product) if purchase_embryo == -3: raise UserError('该订单模型的材料型号暂未设置获取方式和供应商,请先配置再进行分配') diff --git a/jikimo_sale_multiple_supply_methods/views/product_product_views.xml b/jikimo_sale_multiple_supply_methods/views/product_product_views.xml index 2c14d2b5..9c0f67ff 100644 --- a/jikimo_sale_multiple_supply_methods/views/product_product_views.xml +++ b/jikimo_sale_multiple_supply_methods/views/product_product_views.xml @@ -1,13 +1,13 @@ - - + view.product.template.form.inherit.sf product.template - + - - + + + diff --git a/sf_dlm_management/views/product_template_management_view.xml b/sf_dlm_management/views/product_template_management_view.xml index 7f0e9ad5..59f2c0a1 100644 --- a/sf_dlm_management/views/product_template_management_view.xml +++ b/sf_dlm_management/views/product_template_management_view.xml @@ -65,9 +65,6 @@ attrs="{'invisible': [('categ_type', '!=', '夹具')],'required': [('categ_type', '=', '夹具')]}" domain="[('fixture_model_id','=',fixture_model_id)]"/> - - -