This question has been flagged
2 Replies
16481 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 ?

Avatar
Discard

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?

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?

hey guys did you managed to solve this problem

Hi guys did you solve this problem

Best Answer

Hello Odooers,

I think if you are dealing with Monetary fields, then you dont need any code change, only need to set proper

"Decimal Places" in currency settings.

Steps to change Subtotal fields (Monetary) decimal accuracy from 2 digit to 3 digits:

1. Activate Multi Currency from General Settings (Settings > General Settings > Accounting ('Invoicing' If Community)), Now activate Multi-Currencies from Currencies section.

2. Now go to Accounting ('Invoicing' If Community) > Configuration > Accounting > Currencies.

3. In currency form change value 0.010000 to 0.001000 in Rounding Factor field and save record.

I hope this will helpful.

--
Regards
Haresh Kansara
Odoo Application Engineer
  


Avatar
Discard
Best Answer

I know I fixed it, but that was 7 years ago, so I don't remember. Try the following:

  • Go to Settings / Accounting / Accounting and Finance section / Options and make sure "Decimal precision on journal entries" is set to 2.

Let me know if that fixes it for you. If not, I can keep digging.

Avatar
Discard