← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 506521] Re: invoice create returns error : You cannot validate a non-balanced entry (rounding error)

 

Hello Lucas,

This is in response to your last comment, If you are reopen the bug from
it's previous state to new you should have some proper explanation or
steps for reproducing the bug and also specified the version in which
you have faced this.

This code is no more active in current branch as we are using the
function  digits_compute=dp.get_precision('Account') for all accounting
transaction.

For now I am closing this bug, If you have some proper information then
you can reopen or post a new one.

Thanks for your participation.

** Changed in: openobject-addons
       Status: New => Invalid

-- 
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):
  Invalid

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)