Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Controlling decimal precision, inconsistency betwen sales order and invoice form and their printed document

Acar Nila
on 3/27/13, 12:14 AM 4,780 views

Controlling the decimal precision is somewhat very tricky in OpenERP. As an example I want to wipe out the decimal number from all (pricelist, unit price, UoM, UoS, subtotal, tax, etc).

After I adjust it in the Settings --> Database Structure --> Decimal Accuracy (Product Price, Discount, Account, Product Unit of Measure, Product UoS) to become 0 digit, I found that in the Quotation, Sales Order, and Invoice form the "Untaxed Amount", "Taxes", and "Total" still displaying 2 digit decimal precision.

If I print the Quotation or Sales Order, I got the "Quantity" having 2 decimal digit, while "Untaxed Amount", "Taxes", and "Total" and the others don't have decimal digit.

If I print the Invoice I found that the "Quantity" and "Unit Price" have 2 decimal digit, but "Untaxed Amount", "Taxes", and "Total" and the others don't have any decimal digit.

How to make them consistence accross all the form and the printed version ?

I find the same problem. If I put in 6 digits for the Product Price in Settings/Database Structure/Decimal Accuracy, I can see that there are 6 digits in the product's sale price and purchase price, but when I actually use that product in an Expense report line, it shows 6 digits but rounds to 2 digits.

From the file hr_expense.py file, we see this line:

'unit_amount': fields.float('Unit Price', digits_compute=dp.get_precision('Product Price')),

so it looks like this is really where the precision setting is coming from. But where is the rounding coming from?

Tim Ingalls
on 4/5/13, 2:53 AM

It appears the rounding comes from two locations: 1) Settings/Miscellaneous/Currencies. When I choose USD and edit the rounding to 0.000001 (instead of the original 0.010000), I get an error message saying that it can't be more precise than the "Account" setting.

2) So going to Settings/Database Configuration/Decimal Accuracy I find the Account item and change it to 6 digits. Then I can save the USD rounding to 0.000001. But the problem is that I want the pricing to be accurate to 6 decimal digits, but when an invoice is finally created, I need to round the whole invoice to 2 digits. How?

Tim Ingalls
on 4/5/13, 3:32 AM

hey guys did you managed to solve this problem

Erhuvwu Akpobaro
on 1/22/15, 9:46 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 3/27/13, 12:14 AM
Seen: 4780 times
Last updated: 9/10/16, 12:27 PM