From 2c19e9be9691ff02e80ddca8cda05ba87fd16550 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 7 Oct 2015 15:00:01 +0200 Subject: [PATCH] [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 --- 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 efc8ac1d5a3..ee40c055f7b 100644 --- a/openerp/addons/base/res/res_currency.py +++ b/openerp/addons/base/res/res_currency.py @@ -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 '