增加坯料冗余量
This commit is contained in:
@@ -8,7 +8,7 @@ class ProductTemplate(models.Model):
|
||||
|
||||
def product_create(self, product_id, item, order_id, order_number, i):
|
||||
product_id = super(ProductTemplate, self).product_create(product_id, item, order_id, order_number, i)
|
||||
product_id.product_tmpl_id.is_customer_provided = item['is_incoming_material']
|
||||
product_id.product_tmpl_id.is_customer_provided = True if item['embryo_redundancy_id'] else False
|
||||
return product_id
|
||||
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ class SaleOrder(models.Model):
|
||||
'model_width': product.width,
|
||||
'model_height': product.height,
|
||||
'price': product.list_price,
|
||||
'embryo_redundancy_id': line.embryo_redundancy_id,
|
||||
}
|
||||
# 获取成品名结尾-n的n
|
||||
product_seria = int(product.name.split('-')[-1])
|
||||
@@ -66,7 +67,7 @@ class SaleOrder(models.Model):
|
||||
bom.with_user(self.env.ref("base.user_admin")).bom_create_line_has(bom_data)
|
||||
else:
|
||||
# 当成品上带有客供料选项时,生成坯料时选择“客供料”路线
|
||||
if line.is_incoming_material:
|
||||
if line.embryo_redundancy_id:
|
||||
# 将成品模板的内容复制到成品上
|
||||
customer_provided_embryo = self.env.ref('jikimo_sale_multiple_supply_methods.product_template_embryo_customer_provided').sudo()
|
||||
# 创建坯料,客供料的批量不需要创建bom
|
||||
|
||||
Reference in New Issue
Block a user