c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #18920
[Bug 506521] Re: invoice create returns error : You cannot validate a non-balanced entry (rounding error)
please solve this more explanationa bout rounding needed.
** Changed in: openobject-addons
Status: Invalid => New
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/506521
Title:
invoice create returns error : You cannot validate a non-balanced
entry (rounding error)
Status in OpenERP Modules (addons):
New
Bug description:
After upgrading to 5.0.6 a client now runs into this problem,
Some combinations of products ( with taxes and discounts ) give the error
"Integrity Error ! You can not validate a non-balanced entry !"
Invoicing the products separately never gave an issue either.
After some debugging it turned out that the accumulated rounding error
was larger than 0.0001 (see account.py:1024 in stable branch)
-> if abs(amount) < 0.0001:
(Pdb) amount
-0.0099999999999909051
I think this line should be changed to following
if abs(amount) < ( 1.0 / ( int(config['price_accuracy']) * 10 ) ):
*note*: beware the parentheses, it seems python has an issue with 1.0
/ 2 * 10 being 5 (so it's not multiplying before dividing)