You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过xmlrpc使用price_get?Odoo12调用该方法报错求助

解决Odoo12调用price_get方法时的"unhashable type: 'list'"错误

你遇到的错误是因为传给price_get的第一个参数是列表[1],而Odoo12中product.pricelist的price_get方法需要单个整数类型的价格表ID,列表属于不可哈希类型,内部处理时触发了异常。

修改后的调用代码:

priceEntity = odooClient.execute('product.pricelist', 'price_get', 1, 5591, 1, {})

如果要一次性查询多个价格表的产品价格,可以使用price_get_multi方法(该方法支持传入价格表ID列表),示例代码:

priceEntity = odooClient.execute('product.pricelist', 'price_get_multi', [1, 3], 5591, 1, {})

内容的提问来源于stack exchange,提问作者bb sof

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.24 17:07:07