c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #25563
[Bug 791578] [NEW] Methods defined in fields for date, datetime, and time defaults not used
Public bug reported:
In fields.py we define 3 methods for defaults for time, datetime, and
date. they work perfectly fine yet all throughout the code we have
lambda expressions for time.strftime etc. We should update the
documentation, insert in to coding guidelines, and change them when we
see them.
the methods are field.date.today, field.time.now and field.datetime.now
This will help to reduce future errors, adhere to DRY principles, and
make it abundantly clear the preferred method for defaulting time type
fields to the current default. also it is nice to get rid of lambda.
** Affects: openobject-addons
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/791578
Title:
Methods defined in fields for date, datetime, and time defaults not
used
Status in OpenERP Modules (addons):
New
Bug description:
In fields.py we define 3 methods for defaults for time, datetime, and
date. they work perfectly fine yet all throughout the code we have
lambda expressions for time.strftime etc. We should update the
documentation, insert in to coding guidelines, and change them when we
see them.
the methods are field.date.today, field.time.now and
field.datetime.now
This will help to reduce future errors, adhere to DRY principles, and
make it abundantly clear the preferred method for defaulting time type
fields to the current default. also it is nice to get rid of lambda.
Follow ups
-
[Bug 791578] Re: Methods defined in fields for date, datetime, and time defaults not used
From: Vinay Rana (openerp), 2011-06-07
-
[Bug 791578] Re: Methods defined in fields for date, datetime, and time defaults not used
From: Amit Parik (OpenERP), 2011-06-06
-
[Bug 791578] Re: Methods defined in fields for date, datetime, and time defaults not used
From: Graeme Gellatly, 2011-06-01
-
[Bug 791578] [NEW] Methods defined in fields for date, datetime, and time defaults not used
From: Graeme Gellatly, 2011-06-01
References