summaryrefslogtreecommitdiff
path: root/addons/document/document.py
diff options
context:
space:
mode:
authorThibault Delavallée <tde@openerp.com>2014-01-06 14:57:00 +0100
committerThibault Delavallée <tde@openerp.com>2014-01-06 14:57:00 +0100
commit49c0b7a82003a889edc19cb189d0d6d0ebda2c5f (patch)
treed24c9d3fe3baad3ba06f11d4bf334e2504fb6092 /addons/document/document.py
parentc4c268c902a134efdf0f097053c9b28d6b14417c (diff)
parentced63415b7319e12fb9d31a3e370850278f697c1 (diff)
[MERGE] Sync with trunk
bzr revid: tde@openerp.com-20140106135700-rt0g44w5xmpbtxiu
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 5fc62578b1d..eb51ad5ac57 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -32,6 +32,7 @@ import psycopg2
import openerp
from openerp import tools
+from openerp import SUPERUSER_ID
from openerp.osv import fields, osv
from openerp.osv.orm import except_orm
import openerp.report.interface
@@ -322,7 +323,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:
@@ -336,7 +337,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