我在 Odoo 9 社区版中遇到问题,我将数据库字段的小数精度更改为 3,如下所述 还有会计/货币的四舍五入。仅在这两个界面中一切正常:
1:销售订单接口(interface)
2:销售订单
好消息是在开发票时,一切都很好:
1:客户发票
2:发票
这个问题有什么解决办法吗?
最佳答案
在Odoo 9中,所有与金额相关的字段都将字段类型更改为“货币”。它们中的大多数都使用 widget="monetary"进行格式化。为了使其根据货币设置工作,需要“currency_id”字段。因此, View 中必须包含“currency_id”字段。例如,在 sale.order.form View 中
. . .
<tree string="Sales Order Lines" editable="bottom" decoration-info="invoice_status=='to invoice'">
. . .
<field name="price_subtotal" widget="monetary"/>
<field name="currency_id" invisible="1"/> <!-- Add this line -->
. . .
</tree>
然后小计将根据销售订单的货币进行格式化。
关于openerp - odoo中的小数精度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34608113/