Skip to content

Commit

Permalink
[FIX] cron_daylight_saving_time_resistant: Keep test savepoint
Browse files Browse the repository at this point in the history
  • Loading branch information
SirAionTech committed Apr 4, 2024
1 parent 3c580f7 commit 0dc32c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cron_daylight_saving_time_resistant/models/ir_cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def _process_job(cls, db, cron_cr, job):
# be 1 hour too soon) and the date will just be incremented of 1
# hour, each hour...until the changes time really occurs...
if job["daylight_saving_time_resistant"]:
with cls.pool.cursor() as job_cr:
with db.cursor() as job_cr:
try:
cron = api.Environment(
job_cr,
Expand Down
5 changes: 5 additions & 0 deletions cron_daylight_saving_time_resistant/tests/test_dst.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ def _check_cron_date_after_run(self, cron, datetime_str):
{"nextcall": datetime_str, "daylight_saving_time_resistant": True}
)
cron.flush_recordset()
cron.ir_actions_server_id.flush_recordset(
fnames=[
"model_name",
],
)
self.env.cr.execute("SELECT * FROM ir_cron WHERE id = %s", (cron.id,))
job = self.env.cr.dictfetchall()[0]
timezone_date_orig = fields.Datetime.context_timestamp(cron, cron.nextcall)
Expand Down

0 comments on commit 0dc32c1

Please sign in to comment.