summaryrefslogtreecommitdiff
path: root/addons/document
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2014-07-04 17:07:53 +0200
committerOlivier Dony <odo@openerp.com>2014-07-04 17:07:53 +0200
commitf3880a8a0936a097b120a46c2f84b676421fd12e (patch)
treea6df020218a653755d85345bbea308982e8d123c /addons/document
parentcdf517d1781bc59fb403fc2371a6084a770392ce (diff)
parent64ac1b0f46cb38a4dbe5692939e00757dd235645 (diff)
[MERGE] Forward-port of 7.0 up to 64ac1b0
Diffstat (limited to 'addons/document')
-rw-r--r--addons/document/document.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/addons/document/document.py b/addons/document/document.py
index eb51ad5ac57..35261b798fe 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -235,18 +235,8 @@ class document_directory(osv.osv):
_parent(dir_id, path)
return path
- def _check_recursion(self, cr, uid, ids, context=None):
- level = 100
- while len(ids):
- cr.execute('select distinct parent_id from document_directory where id in ('+','.join(map(str,ids))+')')
- ids = filter(None, map(lambda x:x[0], cr.fetchall()))
- if not level:
- return False
- level -= 1
- return True
-
_constraints = [
- (_check_recursion, 'Error! You cannot create recursive directories.', ['parent_id'])
+ (osv.osv._check_recursion, 'Error! You cannot create recursive directories.', ['parent_id'])
]
def onchange_content_id(self, cr, uid, ids, ressource_type_id):