Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX] cron_daylight_saving_time_resistant: Keep test savepoint #2899

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading