Added constrain to avoid recusive work type.

This commit is contained in:
Bertrand Chenal committed 2008-06-02 22:54:55 +02:00
1 parent 9d0ed1d9df
commit 5dd2b286bb
1 file changed
+7
+7
View File
@@ -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