diff options
| author | Olivier Dony <odo@openerp.com> | 2012-02-13 19:03:55 +0100 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2012-02-13 19:03:55 +0100 |
| commit | 2b8a0616c774c75bc25f32d78fdbb69cbc4106f8 (patch) | |
| tree | 8c9e38c91c9be2b46b6ff496f335f502388896ef /addons/web/static/src | |
| parent | 1cf8f5680a701af6a893c2ca55bd249c5bf84065 (diff) | |
[ADD] field.date.context_today: added function to use as _defaults for date fields
As discussed on bug 925361, in order to have
a consistent behavior everywhere we need default
values to be using the client's timezone, just
as if the user had set the value themselves
using their local clock.
Because fields.date values are timezone
agnostic by design, they must be correctly
initialized from the start, no conversion
happens later.
The new context_today method is mean to be
easily usable as _defaults initialize, i.e.:
'date_field': fields.date.context_today
is all that is needed.
It also avoids the classical mistake of
forgetting to make the default value
dynamic and directly passing the result of
a time.strftime() call.
lp bug: https://launchpad.net/bugs/925361 fixed
bzr revid: odo@openerp.com-20120213180355-ruyw5j2w7r06kyue
Diffstat (limited to 'addons/web/static/src')
0 files changed, 0 insertions, 0 deletions
