[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
This commit is contained in:
Quentin (OpenERP)
2011-08-30 14:27:01 +02:00
parent 999efde443
commit 13b2db3631
+1 -1
View File
@@ -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))