[FIX] base: fix _process_job modularity

Before this commit
------------------

Since https://github.com/odoo/odoo/commit/4b28f1162a85d03f9dbe0338b06758ad151ea6a8
It's not possible to override _process_job on ir.cron and
have the new method called by _process_jobs because
_process_jobs calls _proccess_job directly from the class
and do not user the registry anymore

After this commit
-----------------

Use the registry and get ir.cron model to call _process_job

closes odoo/odoo#72897

X-original-commit: b732ebfac934c8fa38a8eb55cfdb59833611c175
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
This commit is contained in:
Thibault Francois
2021-06-28 17:05:25 +00:00
parent 9b478d77f0
commit e1d6c0ee68
+3 -1
View File
@@ -102,7 +102,9 @@ class ir_cron(models.Model):
if not job:
break
_logger.debug("job %s acquired", job['id'])
cls._process_job(db, cron_cr, job)
# take into account overridings of _process_job() on that database
registry = odoo.registry(db_name)
registry[cls._name]._process_job(db, cron_cr, job)
_logger.debug("job %s updated and released", job['id'])
except BadVersion: