← Back to team overview

openerp-india team mailing list archive

[Bug 1158359] Re: account reconcile float calculation error

 

** Tags added: invoicing

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1158359

Title:
  account reconcile float calculation error

Status in OpenERP Addons (modules):
  Confirmed

Bug description:
  In some constellations, the manual reconciliation has an floating
  point bug. so it is possible to have the same value for credit and
  debit but the writeoff is not zero. The bug is in this file and line:

  openerp/addons/account/wizard/account_reconcile.py line 67

  'writeoff': debit - credit

  Original code:

  return {'trans_nbr': count, 'account_id': account_id, 'credit':
  credit, 'debit': debit, 'writeoff': debit - credit}

  Quick fix:

  return {'trans_nbr': count, 'account_id': account_id, 'credit':
  credit, 'debit': debit, 'writeoff': round(debit - credit, 4)}

  Better:

  Use dp.get_precision('Account') to calculate the precision and round
  with this value

  Still better:

  Don't use float for currency calculation ;)

  OpenERP Version openerp-7.0-20130225-002124

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1158359/+subscriptions