diff --git a/base_cron_exclusion/models/ir_cron.py b/base_cron_exclusion/models/ir_cron.py index 9567630d013..acba9b6330d 100644 --- a/base_cron_exclusion/models/ir_cron.py +++ b/base_cron_exclusion/models/ir_cron.py @@ -3,7 +3,7 @@ import logging -from odoo import _, api, fields, models +from odoo import api, fields, models from odoo.exceptions import ValidationError _logger = logging.getLogger(__name__) @@ -17,7 +17,7 @@ def _check_auto_exclusion(self): for item in self: if item in item.mutually_exclusive_cron_ids: raise ValidationError( - _( + self.env._( "You can not mutually exclude a scheduled actions with " "itself." ) @@ -50,8 +50,7 @@ def _lock_mutually_exclusive_cron(db, job_id): lock_cr.execute( """SELECT * FROM ir_cron - WHERE numbercall != 0 - AND active + WHERE active AND id IN %s FOR UPDATE NOWAIT""", (locked_ids,),