本文介绍了如何使用xml-rpc在Odoo中将产品添加到采购订单中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建订单:

new_order = models.execute_kw(db, uid, password,
            'purchase.order', 'create',
            [{'partner_id':VENDOR_ID_soucastky,'product_uom':1, 'bom_id':product.odoo_id, 'product_qty': 1.0}],)

然后我需要添加产品,但是我找不到方法

and then I need to add the products but I can't find how

odoo v9P.S.我需要使用网络服务API,因为我没有ace来更改服务器上的代码

odoo v9P.S. I need to use the webservice API as I don't have aces to change the code on server

推荐答案

创建您的采购订单.然后创建采购订单行,并为其提供新创建的采购订单的order_id.

Create your purchase order. Then create the purchase order lines and give them an order_id of your newly created purchase order.

new_order = models.execute_kw(db, uid, password, 'purchase.order','create', [{'partner_id':VENDOR_ID_soucastky,'product_uom':1, 'bom_id':product.odoo_id, 'product_qty': 1.0}],)

order_line = models.execute_kw(db, uid, password, 'purchase.order.line', 'create', [{ 'name': 'NAME TEXT','product_qty': 1, date_planned': ....... 'order_id': new_order}])

您将必须为new_orderorder_line记录确定适当的值.根据需要重复order_line.

You will have to determine the appropriate values for your new_order and order_line record. Repeat the order_line as necessary.

这篇关于如何使用xml-rpc在Odoo中将产品添加到采购订单中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 07:39