问题
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