summaryrefslogtreecommitdiff
path: root/addons/document/document.py
diff options
context:
space:
mode:
authorXavier ALT <xal@openerp.com>2013-12-16 13:39:54 +0100
committerXavier ALT <xal@openerp.com>2013-12-16 13:39:54 +0100
commit6fab66d6f71b3ec08c9d5b1764fc03feaa1a6be9 (patch)
tree5b322226562c71fe339cd09cd2249f54e2b97419 /addons/document/document.py
parent94b4618c130e325800eee33041909af8733dd567 (diff)
[FIX] document: duplicate directory detection should work even when a record rule prevent user from seeing duplicates
bzr revid: xal@openerp.com-20131216123954-px10qz9g3qxng6c6
Diffstat (limited to 'addons/document/document.py')
-rw-r--r--addons/document/document.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/document/document.py b/addons/document/document.py
index d77dce5288a..bf37018afa8 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -34,6 +34,7 @@ import openerp
from openerp import netsvc
from openerp import pooler
from openerp import tools
+from openerp import SUPERUSER_ID
from openerp.osv import fields, osv
from openerp.osv.orm import except_orm
from openerp.tools.misc import ustr
@@ -323,7 +324,7 @@ class document_directory(osv.osv):
ressource_parent_type_id=vals.get('ressource_parent_type_id',False)
ressource_id=vals.get('ressource_id',0)
if op=='write':
- for directory in self.browse(cr, uid, ids):
+ for directory in self.browse(cr, SUPERUSER_ID, ids):
if not name:
name=directory.name
if not parent_id:
@@ -337,7 +338,7 @@ class document_directory(osv.osv):
if len(res):
return False
if op=='create':
- res=self.search(cr,uid,[('name','=',name),('parent_id','=',parent_id),('ressource_parent_type_id','=',ressource_parent_type_id),('ressource_id','=',ressource_id)])
+ res = self.search(cr, SUPERUSER_ID, [('name','=',name),('parent_id','=',parent_id),('ressource_parent_type_id','=',ressource_parent_type_id),('ressource_id','=',ressource_id)])
if len(res):
return False
return True