diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2015-10-07 15:00:01 +0200 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2016-07-19 12:58:13 +0200 |
| commit | 2c19e9be9691ff02e80ddca8cda05ba87fd16550 (patch) | |
| tree | 79ba2795d8ac467ac3f93ca7088b73223972500f | |
| parent | c3dd3089134e7580ec96d106b3b70d6b40037d22 (diff) | |
[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
| -rw-r--r-- | openerp/addons/base/res/res_currency.py | 2 |
1 files changed, 1 insertions, 1 deletions
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 ' |
