← Back to team overview

openerp-expert-accounting team mailing list archive

[Bug 865387] Re: wrong currency rounding

 

Nicolas,

Just made sure it is ported to 6.1.

See : http://bazaar.launchpad.net/~openerp/openobject-
addons/6.1/annotate/head:/account_voucher/account_voucher.py#L1321

Let me investigate more in detail.

Probable causes/solutions:
1. Good to set 4 as decimal precision/accuracy.
2. Some hectic numbers like x.666666 x.333333 might be causing a mess. In that case, what is proposed is an account that handles such a minor difference and thus it does not stop entries getting validated.
3. Old invoice if they were validated with accuracy 2 and we now use 4 accuracy for voucher! This could be the cause. In such a case, we should manually round the all calculations by 2.  This is a workaround, works good, but not so professional approach for the fix.

Hope this helps.

Thanks.

-- 
You received this bug notification because you are a member of OpenERP
Accounting Experts, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/865387

Title:
  wrong currency rounding

Status in OpenERP Addons (modules):
  Fix Released

Bug description:
  openobject-addons/6.0 revno 4863

  Steps:

   - Configure 'account' module using EUR currency
   - Configure a bank journal for USD currency
   - Create a new rate for USD currency, with date 2011-10-01
   - Create a new invoice, with date 2011-09-01, selecting USD currency and inserting one line of 3638.97 amount
   - Pay the invoice selecting 'Reconcile with Write-Off' (with today's date)

  The write.off entry is not created (it should be produced by the different currency rates).
  This is because of line 88 of base/res/res_currency.py :

  round(amount / currency.rounding) * currency.rounding
  3638.9700000000003

  and this makes false the line 719 of account_voucher.py (line.amount
  == line.amount_unreconciled)

  
  I think the line

  return round(amount / currency.rounding) * currency.rounding

  should be replaced by something like

  float(Decimal(str(amount)).quantize(Decimal(str(currency.rounding)),
  rounding=ROUND_HALF_UP))

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