From 12fcd1be2f1a891b7fe099ad0044e68c45280907 Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Fri, 19 Nov 2010 19:18:01 +0530 Subject: [IMP] : Added context=None on methods used for _constraints and replaced context={} with context=None. bzr revid: uco@tinyerp.com-20101119134801-974ev29j4tu46pq2 --- addons/document/document_storage.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'addons/document/document_storage.py') diff --git a/addons/document/document_storage.py b/addons/document/document_storage.py index aa2edb6b411..eaa4244f10f 100644 --- a/addons/document/document_storage.py +++ b/addons/document/document_storage.py @@ -439,7 +439,7 @@ class document_storage(osv.osv): """ if context is None: 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') @@ -542,7 +542,7 @@ class document_storage(osv.osv): """ if not context: context = {} - boo = self.browse(cr, uid, id, context) + boo = self.browse(cr, uid, id, context=context) if fil_obj: ira = fil_obj else: @@ -688,6 +688,8 @@ 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 @@ -730,6 +732,8 @@ 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 -- cgit v1.2.3 From 6dd290e8245f4ea91ce87b0f3b5f29bafeaf12e9 Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Tue, 23 Nov 2010 12:35:05 +0530 Subject: [REF]: Replace the condition 'if not context' with 'if context is None'. bzr revid: uco@tinyerp.com-20101123070505-9i2lrqhgxzaii3zn --- addons/document/document_storage.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'addons/document/document_storage.py') 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 -- cgit v1.2.3