From d49f0ce8fccf43e409c84ff14a63acf38a8985df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 11 Apr 2023 00:12:33 +0200 Subject: [PATCH] Set cron timezone with default value Closes #12056 --- trytond/trytond/ir/cron.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/trytond/trytond/ir/cron.py b/trytond/trytond/ir/cron.py index a9067c8084..500ec45229 100644 --- a/trytond/trytond/ir/cron.py +++ b/trytond/trytond/ir/cron.py @@ -102,9 +102,13 @@ class Cron(DeactivableMixin, ModelSQL, ModelView): # Migration from 5.0: remove required on next_call table_h.not_null_action('next_call', 'remove') - def get_timezone(self, name): + @classmethod + def default_timezone(cls): return tz.SERVER.tzname(datetime.datetime.now()) + def get_timezone(self, name): + return self.default_timezone() + @classmethod def check_xml_record(cls, crons, values): pass