External API - XML/RPC - How to get the discount price - Odoo V14

陌路散爱 提交于 2021-02-11 13:33:52

问题


For our (personal) webshop I need to get the product discount price using the pricelist linked to a company.

I manage to get the fixed price from a pricelist but when I change the Price Computation from "Fixed price" to "Percentage (discount)" it returns an error.

  • I'm using the external API (XML-RPC) in combination with PHP. https://www.odoo.com/documentation/master/webservices/odoo.html

  • Odoo 14.0+e (Enterprise Edition).

My code:

return $models->execute_kw($db, $uid, $pw, 'product.pricelist', 'price_get', [['4'],84,1]);

When the product (ID 84) in the pricelist (ID 4) has a fixed price it returns the correct product price.

After changing the fixed price to a discount price in Odoo I get this error:

Array
(
    [faultCode] => 4
    [faultString] => Database fetch misses ids (('4',)) and has extra ids ((4,)), may be caused by a type incoherence in a previous request
)

I was looking into the Odoo code but I don't have experience using Python. https://github.com/odoo/odoo/blob/14.0/addons/product/models/product_pricelist.py

来源:https://stackoverflow.com/questions/65422958/external-api-xml-rpc-how-to-get-the-discount-price-odoo-v14

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!