This commit is contained in:
胡尧
2024-11-11 10:22:53 +08:00
parent 2798ce6183
commit 0f37b45b30
26 changed files with 70 additions and 357 deletions

View File

@@ -0,0 +1,13 @@
from odoo import models, fields
class MrpBom(models.Model):
_inherit = 'mrp.bom'
# 业务平台分配工厂后在智能工厂先创建销售订单再创建该产品后再次进行创建bom
def bom_create(self, product, bom_type, product_type):
bom_id = super(MrpBom, self).bom_create(product, bom_type, product_type)
# 成品的供应商从模板中获取
if product_type == 'product':
bom_id.subcontractor_id = product.product_tmpl_id.seller_ids.partner_id.id
return bom_id