Browse Source

Global pylint cleanup

12.0
Simone Orsi 6 years ago
committed by OCA-git-bot
parent
commit
31740b4d81
  1. 10
      base_cron_exclusion/models/ir_cron.py

10
base_cron_exclusion/models/ir_cron.py

@ -14,13 +14,13 @@ _logger = logging.getLogger(__name__)
class IrCron(models.Model): class IrCron(models.Model):
_inherit = "ir.cron" _inherit = "ir.cron"
@api.one
@api.constrains('mutually_exclusive_cron_ids') @api.constrains('mutually_exclusive_cron_ids')
def _check_auto_exclusion(self): 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( mutually_exclusive_cron_ids = fields.Many2many(
comodel_name="ir.cron", relation="ir_cron_exclusion", comodel_name="ir.cron", relation="ir_cron_exclusion",

Loading…
Cancel
Save