生成bom

This commit is contained in:
jinling.yang
2022-10-18 18:36:41 +08:00
parent c06fec0e74
commit 5b75e5423a
6 changed files with 113 additions and 18 deletions

View File

@@ -30,6 +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)
i += 1
res['factory_order_no'] = order_id.name
return json.JSONEncoder().encode(res)