sf1.0
This commit is contained in:
@@ -49,6 +49,7 @@ class Sf_Bf_Connect(http.Controller):
|
||||
logging.info('product:%s' % product)
|
||||
bom_data = request.env['mrp.bom'].with_user(request.env.ref("base.user_admin")).get_bom(product)
|
||||
logging.info('bom_data:%s' % bom_data)
|
||||
i += 1
|
||||
if bom_data:
|
||||
bom = request.env['mrp.bom'].with_user(request.env.ref("base.user_admin")).bom_create(product,
|
||||
'normal',
|
||||
@@ -60,7 +61,7 @@ class Sf_Bf_Connect(http.Controller):
|
||||
self_machining_embryo = request.env['product.template'].sudo().no_bom_product_create(
|
||||
self_machining_id,
|
||||
item,
|
||||
order_id, 'self_machining')
|
||||
order_id, 'self_machining', i)
|
||||
# 创建胚料的bom
|
||||
self_machining_bom = request.env['mrp.bom'].with_user(
|
||||
request.env.ref("base.user_admin")).bom_create(
|
||||
@@ -79,7 +80,8 @@ class Sf_Bf_Connect(http.Controller):
|
||||
outsource_embryo = request.env['product.template'].sudo().no_bom_product_create(outsource_id,
|
||||
item,
|
||||
order_id,
|
||||
'subcontract')
|
||||
'subcontract',
|
||||
i)
|
||||
# 创建胚料的bom
|
||||
outsource_bom = request.env['mrp.bom'].with_user(request.env.ref("base.user_admin")).bom_create(
|
||||
outsource_embryo,
|
||||
@@ -95,14 +97,13 @@ class Sf_Bf_Connect(http.Controller):
|
||||
purchase_embryo = request.env['product.template'].sudo().no_bom_product_create(purchase_id,
|
||||
item,
|
||||
order_id,
|
||||
'purchase')
|
||||
'purchase', i)
|
||||
# 产品配置bom
|
||||
product_bom_purchase = request.env['mrp.bom'].with_user(
|
||||
request.env.ref("base.user_admin")).bom_create(product, 'normal', False)
|
||||
product_bom_purchase.with_user(request.env.ref("base.user_admin")).bom_create_line_has(
|
||||
purchase_embryo)
|
||||
order_id.with_user(request.env.ref("base.user_admin")).sale_order_create_line(product, item)
|
||||
i += 1
|
||||
res['factory_order_no'] = order_id.name
|
||||
except Exception as e:
|
||||
logging.info('get_bfm_process_order_list error:%s' % e)
|
||||
|
||||
Reference in New Issue
Block a user