** Changed in: openobject-addons
       Status: In Progress => Fix Committed

-- 
default date value computed at server startup
https://bugs.launchpad.net/bugs/624509
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.

Status in OpenObject Addons Modules: Fix Committed

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('%Y-%m-%d'),
    ...
}

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('%Y-%m-%d'),
...
stock/stock.py:1260:  'date':  time.strftime('%Y-%m-%d %H:%M:%S'),
...

Code Versions
============
Mainline: 6.0
Server: [email protected]
Addons: codeh...@crowberry-20100826035718-f9pjmr6ydefie407
Client: [email protected]



_______________________________________________
Mailing list: https://launchpad.net/~c2c-oerpscenario
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~c2c-oerpscenario
More help   : https://help.launchpad.net/ListHelp

Reply via email to