Comment 4 for bug 1158359

Revision history for this message
Raphaƫl Valyi - http://www.akretion.com (rvalyi) wrote : Re: [Bug 1158359] Re: account reconcile float calculation error

Guys, I may be wrong but I think float rounding has changed between Python
2.6 and 2.7. May be you guys can tell which Python versions you are using
for your tests?

On Fri, Mar 22, 2013 at 9:51 AM, Amit Bhavsar (Open ERP) <
<email address hidden>> wrote:

> Hello Stephan,
>
> I have double check this Issue. But Still I did not faced the problem.
> That's why I have attached the another screen capture for your
> reference. would you please check It. So currently I am close this
> Issue. If you face the problem again than without hesitation reopen this
> Issue with the brief detail.
>
> Thanks for understanding!
>
> ** Attachment added: "Reconciliation2.png"
>
> https://bugs.launchpad.net/openobject-addons/+bug/1158359/+attachment/3590224/+files/Reconciliation2.png
>
> ** Changed in: openobject-addons
> Status: Incomplete => Invalid
>
> --
> You received this bug notification because you are subscribed to OpenERP
> Addons.
> https://bugs.launchpad.net/bugs/1158359
>
> Title:
> account reconcile float calculation error
>
> Status in OpenERP Addons (modules):
> Invalid
>
> 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
>