优化及调试表面工艺外协出入库单,‘胚料’修改为‘坯料’
This commit is contained in:
@@ -11,7 +11,7 @@ class Sf_Bf_Connect(http.Controller):
|
||||
cors="*")
|
||||
def get_bfm_process_order_list(self, **kw):
|
||||
"""
|
||||
接收业务平台加工订单分配工厂时传送来的订单数据并生成销售订单和产品及胚料
|
||||
接收业务平台加工订单分配工厂时传送来的订单数据并生成销售订单和产品及坯料
|
||||
:param kw:
|
||||
:return:
|
||||
"""
|
||||
@@ -52,16 +52,16 @@ class Sf_Bf_Connect(http.Controller):
|
||||
bom.with_user(request.env.ref("base.user_admin")).bom_create_line_has(bom_data)
|
||||
else:
|
||||
if product.materials_type_id.gain_way == '自加工':
|
||||
# 创建胚料
|
||||
# 创建坯料
|
||||
self_machining_embryo = request.env['product.template'].sudo().no_bom_product_create(
|
||||
self_machining_id,
|
||||
item,
|
||||
order_id, 'self_machining', i)
|
||||
# 创建胚料的bom
|
||||
# 创建坯料的bom
|
||||
self_machining_bom = request.env['mrp.bom'].with_user(
|
||||
request.env.ref("base.user_admin")).bom_create(
|
||||
self_machining_embryo, 'normal', False)
|
||||
# 创建胚料里bom的组件
|
||||
# 创建坯料里bom的组件
|
||||
self_machining_bom_line = self_machining_bom.with_user(
|
||||
request.env.ref("base.user_admin")).bom_create_line(
|
||||
self_machining_embryo)
|
||||
@@ -77,17 +77,17 @@ class Sf_Bf_Connect(http.Controller):
|
||||
product_bom_self_machining.with_user(request.env.ref("base.user_admin")).bom_create_line_has(
|
||||
self_machining_embryo)
|
||||
elif product.materials_type_id.gain_way == '外协':
|
||||
# 创建胚料
|
||||
# 创建坯料
|
||||
outsource_embryo = request.env['product.template'].sudo().no_bom_product_create(outsource_id,
|
||||
item,
|
||||
order_id,
|
||||
'subcontract',
|
||||
i)
|
||||
# 创建胚料的bom
|
||||
# 创建坯料的bom
|
||||
outsource_bom = request.env['mrp.bom'].with_user(request.env.ref("base.user_admin")).bom_create(
|
||||
outsource_embryo,
|
||||
'subcontract', True)
|
||||
# 创建胚料的bom的组件
|
||||
# 创建坯料的bom的组件
|
||||
outsource_bom_line = outsource_bom.with_user(
|
||||
request.env.ref("base.user_admin")).bom_create_line(outsource_embryo)
|
||||
if outsource_bom_line == False:
|
||||
|
||||
Reference in New Issue
Block a user