summaryrefslogtreecommitdiff
path: root/addons/document/document_storage.py
diff options
context:
space:
mode:
authoruco (OpenERP) <uco@tinyerp.com>2010-11-23 12:35:05 +0530
committeruco (OpenERP) <uco@tinyerp.com>2010-11-23 12:35:05 +0530
commit6dd290e8245f4ea91ce87b0f3b5f29bafeaf12e9 (patch)
tree81db1734d8400a9278e5669da35bbe90076397c0 /addons/document/document_storage.py
parent8035df3e1152a8f9d9703037d9d1bee718d94331 (diff)
[REF]: Replace the condition 'if not context' with 'if context is None'.
bzr revid: uco@tinyerp.com-20101123070505-9i2lrqhgxzaii3zn
Diffstat (limited to 'addons/document/document_storage.py')
-rw-r--r--addons/document/document_storage.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/addons/document/document_storage.py b/addons/document/document_storage.py
index eaa4244f10f..b61b7fd65fc 100644
--- a/addons/document/document_storage.py
+++ b/addons/document/document_storage.py
@@ -422,9 +422,7 @@ class document_storage(osv.osv):
optionally, fil_obj could point to the browse object of the file
(ir.attachment)
"""
- if not context:
- context = {}
- boo = self.browse(cr, uid, id, context)
+ boo = self.browse(cr, uid, id, context=context)
if not boo.online:
raise IOError(errno.EREMOTE, 'medium offline')
@@ -540,8 +538,6 @@ class document_storage(osv.osv):
This function MUST be used from an ir.attachment. It wouldn't make sense
to store things persistently for other types (dynamic).
"""
- if not context:
- context = {}
boo = self.browse(cr, uid, id, context=context)
if fil_obj:
ira = fil_obj
@@ -688,8 +684,6 @@ class document_storage(osv.osv):
@return the dict of values that can safely be be stored in the db.
"""
- if not context:
- context = {}
sbro = self.browse(cr, uid, file_node.storage_id, context=context)
assert sbro, "The file #%d didn't provide storage" % file_node.file_id
@@ -732,8 +726,6 @@ class document_storage(osv.osv):
file should move to.
@return the dict of values that can safely be be stored in the db.
"""
- if not context:
- context = {}
sbro = self.browse(cr, uid, file_node.storage_id, context=context)
assert sbro, "The file #%d didn't provide storage" % file_node.file_id