From a4fd0ee84e25b98f04b9e2a3058353d467a60b08 Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Wed, 5 Aug 2020 14:51:54 +0000 Subject: [PATCH] [REM] project: remove duplicate python constraint The constraint method _check_parent_id was defined twice. This commit removes the second definition, less efficient because not using _check_recursion correctly (it can be called on a recordset with multiple records directly). Task Id: 2328664 COM PR: https://github.com/odoo/odoo/pull/55525 ENT PR: https://github.com/odoo/enterprise/pull/12250 --- addons/project/models/project.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/addons/project/models/project.py b/addons/project/models/project.py index 37897a835a6..0cb3ddb513f 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -969,12 +969,6 @@ class Task(models.Model): default['recurrence_id'] = self.recurrence_id.copy().id return super(Task, self).copy(default) - @api.constrains('parent_id') - def _check_parent_id(self): - for task in self: - if not task._check_recursion(): - raise ValidationError(_('Error! You cannot create a recursive hierarchy of tasks.')) - @api.model def get_empty_list_help(self, help): tname = _("task")