diff --git a/jikimo_purchase_request/models/product_template.py b/jikimo_purchase_request/models/product_template.py index 623c0981..c4f2a589 100644 --- a/jikimo_purchase_request/models/product_template.py +++ b/jikimo_purchase_request/models/product_template.py @@ -13,7 +13,11 @@ class ProductTemplate(models.Model): template_id.purchase_request = product_id.purchase_request return template_id + +class ProdcutProduct(models.Model): + _inherit = 'product.product' + def copy_template(self, product_template_id): """ 复制成品模板时,复制采购申请 """ - super(ProductTemplate, self).copy_template(product_template_id) + super(ProdcutProduct, self).copy_template(product_template_id) self.purchase_request = product_template_id.purchase_request diff --git a/jikimo_sale_multiple_supply_methods/models/product_template.py b/jikimo_sale_multiple_supply_methods/models/product_template.py index cd730998..85190cab 100644 --- a/jikimo_sale_multiple_supply_methods/models/product_template.py +++ b/jikimo_sale_multiple_supply_methods/models/product_template.py @@ -6,6 +6,10 @@ class ProductTemplate(models.Model): is_manual_processing = fields.Boolean(string='人工线下加工') is_customer_provided = fields.Boolean(string='客供料') + +class ProductProduct(models.Model): + _inherit = 'product.product' + def copy_template(self, product_template_id): if not isinstance(product_template_id, ProductTemplate): raise ValueError('%s必须是ProductTemplate类型' % product_template_id) diff --git a/sf_manufacturing/models/sale_order.py b/sf_manufacturing/models/sale_order.py index bec19018..8251a78d 100644 --- a/sf_manufacturing/models/sale_order.py +++ b/sf_manufacturing/models/sale_order.py @@ -56,10 +56,10 @@ class SaleOrder(models.Model): 'jikimo_sale_multiple_supply_methods.product_template_manual_processing').sudo() # 复制成品模板上的属性 - line.product_id.product_tmpl_id.copy_template(product_template_id) + line.product_id.copy_template(product_template_id) # 将模板上的single_manufacturing属性复制到成品上 - line.product_id.single_manufacturing = product_template_id.single_manufacturing - line.product_id.tracking = product_template_id.tracking + # line.product_id.single_manufacturing = product_template_id.single_manufacturing + # line.product_id.tracking = product_template_id.tracking order_id = self product = line.product_id