[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
This commit is contained in:
Victor Feyens
2020-11-20 10:04:27 +00:00
parent 46fa7215ad
commit a4fd0ee84e
-6
View File
@@ -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")