From ecdb70c7d60c743cce16fba3e55652c305426938 Mon Sep 17 00:00:00 2001 From: "Claire Bretton (clbr)" Date: Tue, 17 Oct 2023 11:56:39 +0200 Subject: [PATCH] [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. closes odoo/documentation#6628 X-original-commit: 620508fb29e06644eafe2fd91c1fada3002852a6 Signed-off-by: Antoine Vandevenne (anv) Signed-off-by: Claire Bretton (clbr) --- content/developer/tutorials/getting_started/06_firstui.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/developer/tutorials/getting_started/06_firstui.rst b/content/developer/tutorials/getting_started/06_firstui.rst index f6b83c7d9..8b20a4fbf 100644 --- a/content/developer/tutorials/getting_started/06_firstui.rst +++ b/content/developer/tutorials/getting_started/06_firstui.rst @@ -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.