default date value computed at server startup
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Medium
|
OpenERP R&D Addons Team 1 |
Bug Description
Summary
========
When encoding a new line of "task work" inside the project task, the default date provided is always the same.
Use Case:
========
Start openerp-server, start time is: 2010-08-25 08:00:15
encode a new task work, the default date is: 2010-08-25 08:00:15
5 minutes later, encode a new task work, the default date is still: 2010-08-25 08:00:15
Details
======
The default value for task.work is specified like this:
_defaults = {
...
'date': time.strftime(
...
}
The problem here, is that the "date" will be computed when the object is instantiated, not when the client request default date. For this kind of default value, we should specify it using the "lambda" way.
Lot of others modules seems to declare default value like this, for example:
...
sale/sale.py:284: 'date_order': time.strftime(
...
stock/stock.
...
Code Versions
============
Mainline: 6.0
Server: <email address hidden>
Addons: codehost@
Client: <email address hidden>
Related branches
- OpenERP R&D Team: Pending requested
-
Diff: 28 lines (+5/-2)2 files modifiedcrm/crm.py (+4/-1)
crm/crm_meeting_view.xml (+1/-1)
- OpenERP Core Team: Pending requested
-
Diff: 177 lines (+32/-15)9 files modifiedcrm/crm.py (+13/-1)
crm/crm_meeting_view.xml (+1/-1)
crm/wizard/crm_add_note_view.xml (+1/-1)
l10n_ch/wizard/create_dta.py (+0/-1)
mrp/mrp.py (+1/-2)
project/wizard/project_task_close.py (+9/-3)
project/wizard/project_task_delegate.py (+4/-4)
project_planning/project_planning_demo.xml (+2/-2)
thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/tiny_xmlrpc.js (+1/-0)
- OpenERP Core Team: Pending requested
- Diff: 0 lines
Changed in openobject-addons: | |
assignee: | nobody → OpenERP R&D Addons Team 1 (openerp-dev-addons1) |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
Changed in openobject-addons: | |
status: | In Progress → Fix Committed |
Changed in openobject-addons: | |
status: | Fix Committed → Fix Released |