[REF] Base: small improvement

bzr revid: mra@tinyerp.com-20110825170657-tgajqc4yknz9f83b
This commit is contained in:
Mustufa Rangwala (OpenERP) 2011-08-25 22:36:57 +05:30
parent 5b17d2ccb7
commit e117018b7b
1 changed files with 2 additions and 3 deletions

View File

@ -107,11 +107,11 @@ class res_currency(osv.osv):
if context is None:
context = {}
ctx = context.copy()
ctx.update({'currency_rate_type_id': ctx.get('currency_rate_type_from')})
ctx.update({'currency_rate_type_id': ctx.get('currency_rate_type_from', False)})
from_currency = self.browse(cr, uid, [from_currency.id], context=ctx)[0]
from_currency_rate = from_currency['rate']
ctx.update({'currency_rate_type_id': ctx.get('currency_rate_type_to')})
ctx.update({'currency_rate_type_id': ctx.get('currency_rate_type_to', False)})
to_currency = self.browse(cr, uid, [to_currency.id], context=ctx)[0]
to_currency_rate = to_currency['rate']
@ -124,7 +124,6 @@ class res_currency(osv.osv):
raise osv.except_osv(_('Error'), _('No rate found \n' \
'for the currency: %s \n' \
'at the date: %s') % (currency_symbol, date))
return to_currency_rate/from_currency_rate
def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount,