Skip to content

Commit

Permalink
Merge commit 'refs/pull/146147/head' of https://github.com/odoo/odoo
Browse files Browse the repository at this point in the history
…into 16.0-4700
  • Loading branch information
docker-odoo committed Dec 15, 2023
2 parents 9d1a01b + 1b3825e commit f0fae52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions odoo/addons/base/models/ir_cron.py
Expand Up @@ -88,7 +88,7 @@ def default_get(self, fields_list):
def method_direct_trigger(self):
self.check_access_rights('write')
for cron in self:
cron.with_user(cron.user_id).with_context({'lastcall': cron.lastcall}).ir_actions_server_id.run()
cron.with_user(cron.user_id).with_context({'lastcall': cron.lastcall, 'job_id': cron.id}).ir_actions_server_id.run()
cron.lastcall = fields.Datetime.now()
return True

Expand Down Expand Up @@ -297,7 +297,7 @@ def _process_job(cls, db, cron_cr, job):
with cls.pool.cursor() as job_cr:
lastcall = fields.Datetime.to_datetime(job['lastcall'])
interval = _intervalTypes[job['interval_type']](job['interval_number'])
env = api.Environment(job_cr, job['user_id'], {'lastcall': lastcall})
env = api.Environment(job_cr, job['user_id'], {'lastcall': lastcall, 'job_id': job['id']})
ir_cron = env[cls._name]

# Use the user's timezone to compare and compute datetimes,
Expand Down

0 comments on commit f0fae52

Please sign in to comment.