【问题标题】:Odoo 8 , how to convert an existing Quotation to Sales order via XMLRPCOdoo 8,如何通过 XMLRPC 将现有报价转换为销售订单
【发布时间】:2023-04-09 15:46:01
【问题描述】:

1] 我已经通过 XMLRPC 在 Odoo 8 Setup 中创建了一个报价:

return_id = api.execute_kw(db, uid, pwd, 'sale.order','create',[{'note':'******~~~~~********','state':'draft','order_policy':'manual','amount_tax':0.0,'amount_untaxed':0.0,'amount_total':0.0,'partner_invoice_id':22, 'partner_shipping_id':22}])

2] 然后在此报价单中添加一个订单行:

return_id =  api.execute_kw(db, uid, pwd,'sale.order.line','create',  [{ 'product_id':2,'product_uos_quantity':1.000,   'order_id':37, 'quantity':1 }]);

现在我需要的是把这个报价进一步通过XMLRPC转换成销售订单,这样就可以刺激所有正常的“确认销售”按钮操作,例如记录消息、将报价转换为销售订单以及在所有必需的表格中进行所有必要的更改。

【问题讨论】:

    标签: odoo-8 odoo xml-rpc


    【解决方案1】:

    您将使用以下代码通过 xmlrpc 确认销售订单。这里 sale_order_id 是销售订单的 ID,您在创建销售订单时获得。通过执行代码,报价转化为销售订单。

    api.exec_workflow(db, uid, password, 'sale.order', 'order_confirm', sale_order_id)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多