Search code examples
odooodoo-9

Decimal precision in odoo


I have a problem in Odoo 9 Community Edition, I changed the decimal accuracy of the database fields to 3 as stated to below enter image description here And also the rounding in Accounting/Currencies. Everything works fine only in these two interfaces:

1: Sales orders interface

enter image description here

2: A sale order

enter image description here

The good thing is that in invoicing, everything is fine:

1: Client Invoices

enter image description here

2: An invoice

enter image description here

Is there any solution to this issue?


Solution

  • In Odoo 9, all the fields related to amount have changed the field type to "Monetary". Most of them are formatted using widget="monetary". In order for it to work according to the currency setting, "currency_id" field is required. Hence "currency_id" field must be included in the view. For example, in 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>
    

    The subtotal will then be formatted according to the currency of the sales order.