Skip to content

Commit

Permalink
[FIX] base: validate timezones again
Browse files Browse the repository at this point in the history
In odoo#154177 it was apparently decided that validating callable
selections is unnecessary, leading to the lang and timezone fields not
being validated anymore.

Nothing to be done for the lang as it relies on the installed langs
and thus the corresponding database, however the tz list has
effectively been static / global since
odoo#26496 (f11d143). So
initialise `tz` with the precomputed value instead of the function
which returns the precomputed value.

Part-of: odoo#170995
Signed-off-by: Xavier Morel (xmo) <[email protected]>
  • Loading branch information
xmo-odoo committed Jun 27, 2024
1 parent f794f85 commit 637f6c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion odoo/addons/base/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def default_get(self, default_fields):
lang = fields.Selection(_lang_get, string='Language',
help="All the emails and documents sent to this contact will be translated in this language.")
active_lang_count = fields.Integer(compute='_compute_active_lang_count')
tz = fields.Selection(_tz_get, string='Timezone', default=lambda self: self._context.get('tz'),
tz = fields.Selection(_tzs, string='Timezone', default=lambda self: self._context.get('tz'),
help="When printing documents and exporting/importing data, time values are computed according to this timezone.\n"
"If the timezone is not set, UTC (Coordinated Universal Time) is used.\n"
"Anywhere else, time values are computed according to the time offset of your web client.")
Expand Down

0 comments on commit 637f6c9

Please sign in to comment.