diff options
| author | Olivier Dony <odo@openerp.com> | 2013-12-16 15:22:46 +0100 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2013-12-16 15:22:46 +0100 |
| commit | 89a6771f6a50ea263445090dbae2e99ab8d99a5d (patch) | |
| tree | 8d4205efa4595711e2c06c61425bdc2ee3c697b2 /addons/document/document.py | |
| parent | 1a9f24c56d09e92c72d431e0fe6242bcf9cc7d33 (diff) | |
| parent | d08821442e47efd873eb167e68bfa145b2de3e6f (diff) | |
[MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9698, revision-id: odo@openerp.com-20131216142049-xh9gxy5cir3p2i09
bzr revid: dle@openerp.com-20131216111534-0w0jdod25ff3iapc
bzr revid: odo@openerp.com-20131216142246-unt6qqb23uq53we1
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 |
