summaryrefslogtreecommitdiff
path: root/addons/document/document.py
diff options
context:
space:
mode:
authorHarry (OpenERP) <hmo@tinyerp.com>2010-07-13 20:01:41 +0530
committerHarry (OpenERP) <hmo@tinyerp.com>2010-07-13 20:01:41 +0530
commit72c068a75e0811fc0aaaeb8622afab2b1f1c3ede (patch)
tree1741d7aad768d613d970a30d54a4c0af2cc87ed7 /addons/document/document.py
parent506b249a0fc32f5c6dad50ae85c39c45b0a4f9c2 (diff)
parentbbbf42c6ba0f5aa05a53c5b31f909432cbd5f708 (diff)
[MERGE]
bzr revid: hmo@tinyerp.com-20100713143141-wozs7fnurj8ckblw
Diffstat (limited to 'addons/document/document.py')
-rw-r--r--addons/document/document.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/addons/document/document.py b/addons/document/document.py
index 6ab6cae5281..ac3d7b9187d 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -47,7 +47,10 @@ class document_file(osv.osv):
def _data_get(self, cr, uid, ids, name, arg, context):
fbrl = self.browse(cr, uid, ids, context=context)
- nctx = nodes.get_node_context(cr, uid, context)
+ nctx = nodes.get_node_context(cr, uid, context={})
+ # nctx will /not/ inherit the caller's context. Most of
+ # it would be useless, anyway (like active_id, active_model,
+ # bin_size etc.)
result = {}
bin_size = context.get('bin_size', False)
for fbro in fbrl:
@@ -67,7 +70,7 @@ class document_file(osv.osv):
if not value:
return True
fbro = self.browse(cr, uid, id, context=context)
- nctx = nodes.get_node_context(cr, uid, context)
+ nctx = nodes.get_node_context(cr, uid, context={})
fnode = nodes.node_file(None, None, nctx, fbro)
res = fnode.set_data(cr, base64.decodestring(value), fbro)
return res
@@ -156,7 +159,7 @@ class document_file(osv.osv):
raise osv.except_osv(_('ValidateError'), _('File name must be unique!'))
if ('parent_id' in vals) or ('name' in vals):
# perhaps this file is renaming or changing directory
- nctx = nodes.get_node_context(cr,uid,context)
+ nctx = nodes.get_node_context(cr,uid,context={})
dirobj = self.pool.get('document.directory')
if 'parent_id' in vals:
dbro = dirobj.browse(cr, uid, vals['parent_id'], context=context)