This code must be removed from addons/base/res/res_currency.py
(remove the account arg also)

2        if account and (account.currency_mode=='average') and 
account.currency_id:
2            q = self.pool.get('account.move.line')._query_get(cr, uid, 
context=context)
2            cr.execute('select sum(debit-credit),sum(amount_currency) from 
account_move_line l ' \
2              'where l.currency_id=%s and l.account_id=%s and '+q, 
(account.currency_id.id,account.id,))
2            tot1,tot2 = cr.fetchone()

-- 
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/557325

Title:
  res_currency.compute should check for currency differences before any rate 
fetch

Status in OpenObject Server:
  Confirmed

Bug description:
  The code in res_currency.compute can be optimized by checking whether we are 
working with different currencies or not before fetching any conversion rate 
from the database. Doing it this way we make easier to work when working with 
only one currency, without taking care of having the current conversion rates 
already loaded in the database. Actually I've found this by creating an invoice 
with EUR-only products and customers for a date before 2010-01-01, which is the 
date of the oldest EUR conversion rate stored in the database.



_______________________________________________
Mailing list: https://launchpad.net/~c2c-oerpscenario
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~c2c-oerpscenario
More help   : https://help.launchpad.net/ListHelp

Reply via email to