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

Odoo 17:如何通过XML API使用含税总价创建销售订单

Shopware 6.5导入Odoo 17销售订单时的计税误差与API含税总价使用问题

从Shopware 6.5网店导入销售订单到Odoo 17时,因计税方式差异导致订单总价出现几分钱的四舍五入误差。Odoo本身支持B2C价目表解决此类问题,但通过XML API创建销售订单时,使用如下请求数据:

{
  "carrier_id": 3,
  "client_order_ref": "13725",
  "company_id": 1,
  "name": "Order 13725",
  "note": "thanks :-)",
  "order_line": [
    [
      0,
      0,
      {
        "product_id": 101,
        "display_name": "Demo Product #1",
        "name": "Demo Product #1",
        "product_uom_qty": 1,
        "price_unit": 1,
        "price_tax": 0.07,
        "tax_id": [
          [
            6,
            0,
            [
              76
            ]
          ]
        ]
      }
    ]
  ],
  "partner_id": 13895
}

发现sale.order.line的price_total字段为只读,请问如何通过API使用含税总价?


2024-08-20补充:修正误差的一种方法是对比总金额,添加一条“调整项”销售订单行来增减差额。


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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.19 23:17:02