diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2016-07-29 15:14:53 +0200 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2016-08-01 13:29:16 +0200 |
| commit | 2ee4afda2f4dc3a5c132895bd4427493b44a972e (patch) | |
| tree | 3e29b7b36f1bc4dceaa757c9a9a7d6eea9887420 | |
| parent | 9b5fed49769d2e010f29f73b0f288de63bd26bc4 (diff) | |
[FIX] base: currency exchange rate date
When creating a new exchange rate, the default date is always the date
of the last server restart.
This is because `fields.Date.today() + ' 00:00:00'` is a fixed string
and the field is instanciated only at startup.
opw-684622
| -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 e5a354b2106..1f719522d9d 100644 --- a/openerp/addons/base/res/res_currency.py +++ b/openerp/addons/base/res/res_currency.py @@ -227,7 +227,7 @@ class CurrencyRate(models.Model): _description = "Currency Rate" _order = "name desc" - name = fields.Datetime(string='Date', required=True, index=True, default=fields.Date.today() + ' 00:00:00') + name = fields.Datetime(string='Date', required=True, index=True, default=lambda self:fields.Date.today() + ' 00:00:00') rate = fields.Float(digits=(12, 6), help='The rate of the currency to the currency of rate 1') currency_id = fields.Many2one('res.currency', string='Currency', readonly=True) company_id = fields.Many2one('res.company', string='Company') |
