解决产品模板复制的问题
This commit is contained in:
@@ -13,11 +13,7 @@ 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(ProdcutProduct, self).copy_template(product_template_id)
|
||||
super(ProductTemplate, self).copy_template(product_template_id)
|
||||
self.purchase_request = product_template_id.purchase_request
|
||||
|
||||
@@ -6,10 +6,6 @@ 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)
|
||||
|
||||
@@ -17,7 +17,7 @@ class ResProductCategory(models.Model):
|
||||
class ResProductProduct(models.Model):
|
||||
_inherit = 'product.product'
|
||||
|
||||
single_manufacturing = fields.Boolean(string="单个制造")
|
||||
# single_manufacturing = fields.Boolean(string="单个制造")
|
||||
is_bfm = fields.Boolean('业务平台是否自动创建', default=False)
|
||||
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ class SaleOrder(models.Model):
|
||||
'jikimo_sale_multiple_supply_methods.product_template_manual_processing').sudo()
|
||||
|
||||
# 复制成品模板上的属性
|
||||
line.product_id.copy_template(product_template_id)
|
||||
line.product_id.product_tmpl_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
|
||||
|
||||
Reference in New Issue
Block a user