From 31740b4d81cdbf8bc276acbd0c014fa6e9f9a5a3 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Mon, 3 Sep 2018 10:00:27 +0200 Subject: [PATCH] Global pylint cleanup --- base_cron_exclusion/models/ir_cron.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/base_cron_exclusion/models/ir_cron.py b/base_cron_exclusion/models/ir_cron.py index a6ad8591c..499b774ac 100644 --- a/base_cron_exclusion/models/ir_cron.py +++ b/base_cron_exclusion/models/ir_cron.py @@ -14,13 +14,13 @@ _logger = logging.getLogger(__name__) class IrCron(models.Model): _inherit = "ir.cron" - @api.one @api.constrains('mutually_exclusive_cron_ids') def _check_auto_exclusion(self): - if self in self.mutually_exclusive_cron_ids: - raise ValidationError(_( - "You can not mutually exclude a scheduled actions with " - "itself.")) + for item in self: + if item in item.mutually_exclusive_cron_ids: + raise ValidationError(_( + "You can not mutually exclude a scheduled actions with " + "itself.")) mutually_exclusive_cron_ids = fields.Many2many( comodel_name="ir.cron", relation="ir_cron_exclusion",