修改胚料匹配规则

This commit is contained in:
jinling.yang
2022-10-19 11:16:35 +08:00
parent 5b75e5423a
commit c2bf0b09a9
2 changed files with 8 additions and 6 deletions

View File

@@ -30,8 +30,8 @@ class Sf_Bf_Connect(http.Controller):
product = request.env['product.template'].sudo().product_create(product_id, item, order_id,
ret['order_number'], i)
order_id.with_user(request.env.ref("base.user_admin")).sale_order_create_line(product, item)
bom = request.env['mrp.bom'].sudo().bom_create(product)
bom.sudo().bom_create_Line(product)
bom = request.env['mrp.bom'].with_user(request.env.ref("base.user_admin")).bom_create(product)
bom.with_user(request.env.ref("base.user_admin")).bom_create_Line(product)
i += 1
res['factory_order_no'] = order_id.name
return json.JSONEncoder().encode(res)