summaryrefslogtreecommitdiff
path: root/addons/document/document.py
diff options
context:
space:
mode:
authorXavier ALT <xal@openerp.com>2013-12-16 14:19:49 +0100
committerXavier ALT <xal@openerp.com>2013-12-16 14:19:49 +0100
commit0a3b4b7fb7100e2117b9de13ee77b6db22292b45 (patch)
treebe105fa61c19bee4fb5d61abafc16d50d95aa7df /addons/document/document.py
parentaf22a1c5b7b144965e8d14dce134563a3cf4e577 (diff)
parent6fab66d6f71b3ec08c9d5b1764fc03feaa1a6be9 (diff)
[FIX] document: duplicate directory detection should work even when a record rule prevent user from seeing duplicates
bzr revid: xal@openerp.com-20131216131949-6k0fxumgl1k1roy1
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