mirror of
https://github.com/odoo/documentation.git
synced 2026-01-02 17:59:20 +07:00
[FIX] getting_started: remove useless lambda
The lambda function here is useless and makes newdooers think they need to use it everytime. `default=fields.Date.add(fields.Date.today(), months=3))` should do the trick, no lambda involved.
This commit is contained in:
@@ -232,7 +232,7 @@ Any field can be given a default value. In the field definition, add the option
|
||||
float, string) or a function taking a model and returning a value::
|
||||
|
||||
name = fields.Char(default="Unknown")
|
||||
last_seen = fields.Datetime("Last Seen", default=lambda self: fields.Datetime.now())
|
||||
last_seen = fields.Datetime("Last Seen", default=fields.Datetime.now)
|
||||
|
||||
The ``name`` field will have the value 'Unknown' by default while the ``last_seen`` field will be
|
||||
set as the current time.
|
||||
|
||||
Reference in New Issue
Block a user