Skip to content
Snippets Groups Projects
Commit 09687c0b authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[FIX] account: balance not rounded

- Set the Product Price precision to 5
- Create an invoice with one line:
  No taxes
  Price Unit: 0.895
- Save

An error is raised because of an unbalanced journal entry.

The root cause is the `balance` which is not rounded. This is due to the
fact that the currency field (`company_currency_id`) is a related and
not set at the moment of computation. This leads to this being equal to
`0.01` instead of zero:

https://github.com/odoo/odoo/blob/ed1926cb12c830f383dbe540cb96e14d0804eb3d/addons/account/models/account_payment_term.py#L64



Note that if the line is saved with another value then the price unit
is modified, the error doesn't occur since the balance is properly
rounded.

opw-2209543

closes odoo/odoo#50489

Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
parent 95fbe82d
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment