From c898e02860bd358ecd2f00a7da7df6b9ed66e56e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Wed, 14 May 2025 17:02:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=88=B6=E9=80=A0=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E5=AD=97=E6=AE=B5=E6=9C=AA=E5=A4=8D=E5=88=B6=E5=88=B0?= =?UTF-8?q?=E6=88=90=E5=93=81=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jikimo_purchase_request/models/product_template.py | 6 +++++- .../models/product_template.py | 4 ++++ sf_manufacturing/models/sale_order.py | 6 +++--- 3 files changed, 12 insertions(+), 4 deletions(-) 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