openerp - odoo中的小数精度

标签 openerp odoo-9

我在 Odoo 9 社区版中遇到问题,我将数据库字段的小数精度更改为 3,如下所述 enter image description here 还有会计/货币的四舍五入。仅在这两个界面中一切正常:

1:销售订单接口(interface)

enter image description here

2:销售订单

enter image description here

好消息是在开发票时,一切都很好:

1:客户发票

enter image description here

2:发票

enter image description here

这个问题有什么解决办法吗?

最佳答案

在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/

相关文章:

openerp - 在 Odoo 中创建新组

filter - 如何使用函数过滤域 View ?在 odoo 9

python - 奥杜。在 werkzeug 中动态注入(inject) url

odoo-9 - 如何获得批号的可用数量

python - Odoo 模块的升级如何进行?

upgrade - 如何将 OpenERP 5.0 升级到 6.0

python - [Odoo][Qweb]字典foreach,打印键和值

xml - 我怎样才能在odoo的表格中只添加一条记录

python - 值 0 时触发用户错误