From 13b2db36315bfb4407b9b53728cb648ae77a085a Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Tue, 30 Aug 2011 14:27:01 +0200 Subject: [PATCH] [FIX] base, res.currency: ProgrammingError. When giving a context value like {'currency_rate_type_id': False}, it crashed because the value False was kept instead of None. Thanks Guewen (c2c) for the clue. bzr revid: qdp-launchpad@openerp.com-20110830122701-yrcpo19lokkgrpcc --- openerp/addons/base/res/res_currency.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/res/res_currency.py b/openerp/addons/base/res/res_currency.py index 422d40db727..c9cd36276ba 100644 --- a/openerp/addons/base/res/res_currency.py +++ b/openerp/addons/base/res/res_currency.py @@ -36,7 +36,7 @@ class res_currency(osv.osv): else: date = time.strftime('%Y-%m-%d') date = date or time.strftime('%Y-%m-%d') - currency_rate_type = context.get('currency_rate_type_id', None) + currency_rate_type = context.get('currency_rate_type_id') or None operator = currency_rate_type and '=' or 'is' for id in ids: cr.execute("SELECT currency_id, rate FROM res_currency_rate WHERE currency_id = %s AND name <= %s AND currency_rate_type_id " + operator +" %s ORDER BY name desc LIMIT 1" ,(id, date, currency_rate_type))