[FIX] base: cherry-pick 55fa0912 to 8.0

Backported to 8.0 following report at #12648

[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.

Fixes #12648
This commit is contained in:
Nicolas Martinelli 2015-10-07 15:00:01 +02:00 committed by Martin Trigaux
parent c3dd308913
commit 2c19e9be96
No known key found for this signature in database
GPG Key ID: 7B0E288E7C0F83A7
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,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()
for id in ids:
cr.execute('SELECT rate FROM res_currency_rate '
'WHERE currency_id = %s '