From 108db379d07eef72ba427428c83c8b799c2cc458 Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Wed, 24 Aug 2011 11:14:16 +0530 Subject: [PATCH] [REF] base: Changed code to avoid overriding of context values. bzr revid: uco@tinyerp.com-20110824054416-ngrtkk5oh1v9jgb3 --- openerp/addons/base/res/res_currency.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/openerp/addons/base/res/res_currency.py b/openerp/addons/base/res/res_currency.py index 8a8067c6ff4..13bb14d0578 100644 --- a/openerp/addons/base/res/res_currency.py +++ b/openerp/addons/base/res/res_currency.py @@ -125,13 +125,9 @@ class res_currency(osv.osv): if not to_currency_id: to_currency_id = from_currency_id - context.update({'currency_rate_type_id': False}) - if currency_rate_type_from: - context.update({'currency_rate_type_id': currency_rate_type_from}) - if currency_rate_type_to: - context.update({'currency_rate_type_id': currency_rate_type_to}) - + context.update({'currency_rate_type_id': currency_rate_type_from}) xc = self.browse(cr, uid, [from_currency_id], context=context) + context.update({'currency_rate_type_id': currency_rate_type_to}) xc1 = self.browse(cr, uid, [to_currency_id], context=context) from_currency = (xc[0].id == from_currency_id and xc[0]) or xc[1] to_currency = (xc1[0].id == to_currency_id and xc1[0]) or xc1[1]