OpenERP/Odoo: fields.datetime.now() show the date of the latest restart
<p>I have a field datetime. This field should have by default the datetime of "now", the current time.</p>

<p>However, the default date is the time of <strong>the lastest restart</strong>. </p>

<p>Please find below my code:</p>

<pre><code>'date_action': fields.datetime('Date current action', required=False, readonly=False, select=True),

_defaults = {
    'date_action': fields.datetime.now(),
</code></pre>

<p>You are setting the default value of <code>date_action</code> as the value returned by <code>fields.datetime.now()</code>, that is executed when odoo server is started.</p>

<p>You should set the default value as the call to the method:</p>

<pre><code>'date_action': fields.datetime.now,
</code></pre>

python datetime openerp