From 55fa0912feead65c293ca89f871edd4005acf9df Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 7 Oct 2015 15:00:01 +0200 Subject: [PATCH] [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. --- 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 6f890b5d4ee..85f383f7825 100644 --- a/openerp/addons/base/res/res_currency.py +++ b/openerp/addons/base/res/res_currency.py @@ -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