diff --git a/work_type.py b/work_type.py index d372ddc6a0..e6810935e4 100644 --- a/work_type.py +++ b/work_type.py @@ -20,6 +20,13 @@ class WorkType(OSV): ('normal', 'Normal'), ], 'Type', required=True, select=1) + def __init__(self): + super(WorkType, self).__init__() + self._constraints += [ + ('check_recursion', + 'Error! You can not create recursive work types.', ['parent']) + ] + def default_active(self, cursor, user, context=None): return True