ir.cron uses relativedelta and fills it from several fields of the model. Relativedelta itself seems to have no constraints on the range of values used, but it crashes when you try to increase the value of a datetime with a relativedelta(hour=24), with the following backtrace:
Traceback (most recent call last):
File "/tryton/trytond/trytond/ir/cron.py", line 134, in run
cron.next_call = cron.compute_next_call(now)
File "/tryton/trytond/trytond/ir/cron.py", line 103, in compute_next_call
weekday=int(self.weekday.index) if self.weekday else None))
File "/usr/local/lib/python3.7/dist-packages/dateutil/relativedelta.py", line 405, in __radd__
return self.__add__(other)
File "/usr/local/lib/python3.7/dist-packages/dateutil/relativedelta.py", line 387, in __add__
ret = (other.replace(**repl)
ValueError: hour must be in 0..23
So we must ensure we follow relativedelta constraints which are:
I see two possibilities:
Opinions?
History | |||
---|---|---|---|
Date | User | Action | Args |
2021-03-13 12:01:25 | albertca | set | messageid: <1615633285.72845.IIYEQ3N7FKWPGLLY.issue10193@tryton.org> |
2021-03-13 12:01:25 | albertca | link | issue10193 messages |
2021-03-13 12:01:25 | albertca | create |
Showing 10 items. Show all history (warning: this could be VERY long)