diff --git a/cron_daylight_saving_time_resistant/models/ir_cron.py b/cron_daylight_saving_time_resistant/models/ir_cron.py index 62273647a41..1e9a32b89fc 100644 --- a/cron_daylight_saving_time_resistant/models/ir_cron.py +++ b/cron_daylight_saving_time_resistant/models/ir_cron.py @@ -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, diff --git a/cron_daylight_saving_time_resistant/tests/test_dst.py b/cron_daylight_saving_time_resistant/tests/test_dst.py index 25ab5d81bca..04fe61c3aae 100644 --- a/cron_daylight_saving_time_resistant/tests/test_dst.py +++ b/cron_daylight_saving_time_resistant/tests/test_dst.py @@ -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)