diff options
| author | Atul Patel (OpenERP) <atp@tinyerp.com> | 2014-02-18 11:26:18 +0530 |
|---|---|---|
| committer | Atul Patel (OpenERP) <atp@tinyerp.com> | 2014-02-18 11:26:18 +0530 |
| commit | 33b99c8a0737e08e6a243e41bb455d3ab7e6c851 (patch) | |
| tree | a1db52bfbeecf0c6fd9096604b7ec4540bb04197 /addons/document/document.py | |
| parent | caa3510ea434e10c32dcbc134f9c74b2b9f18b2a (diff) | |
| parent | aa0eac1257b97c1be693e8a804fec6ecbf2bb22f (diff) | |
[MERGE]: Merged with addons
bzr revid: atp@tinyerp.com-20140218055618-r36w29vat7zig9ar
Diffstat (limited to 'addons/document/document.py')
| -rw-r--r-- | addons/document/document.py | 5 |
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 |
