[FIX] base: use datetime instead of date

The variable `date` is compared to the field `name` in the selection
query. `name` is filled in with datetime data. In particular, in the
module currency_rate_live, datetime.now() is used in the name. It is
necessary to make an appropriate comparison to make sure we select the
updated rate right away.
This commit is contained in:
Nicolas Martinelli
2015-10-07 18:48:12 +02:00
parent 3571c0e4a4
commit 55fa0912fe
+1 -1
View File
@@ -20,7 +20,7 @@ class res_currency(osv.osv):
context = {}
res = {}
date = context.get('date') or time.strftime('%Y-%m-%d')
date = context.get('date') or fields2.Datetime.now()
company_id = context.get('company_id') or self.pool['res.users']._get_company(cr, uid, context=context)
for id in ids:
cr.execute("""SELECT rate FROM res_currency_rate