From e117018b7b0d7896ad886c871589a7defb45dec5 Mon Sep 17 00:00:00 2001 From: "Mustufa Rangwala (OpenERP)" Date: Thu, 25 Aug 2011 22:36:57 +0530 Subject: [PATCH] [REF] Base: small improvement bzr revid: mra@tinyerp.com-20110825170657-tgajqc4yknz9f83b --- openerp/addons/base/res/res_currency.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openerp/addons/base/res/res_currency.py b/openerp/addons/base/res/res_currency.py index f8bd4f21893..8182a207c5c 100644 --- a/openerp/addons/base/res/res_currency.py +++ b/openerp/addons/base/res/res_currency.py @@ -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,