diff options
| author | rpa (Open ERP) <rpa@tinyerp.com> | 2010-12-20 13:52:55 +0530 |
|---|---|---|
| committer | rpa (Open ERP) <rpa@tinyerp.com> | 2010-12-20 13:52:55 +0530 |
| commit | 4e307d022c8fbdba848b8a4f57d668a4b6bd036f (patch) | |
| tree | 249f8361bac695c0bec0c844d964194202d680a0 /addons/document/document.py | |
| parent | 6e34e7c52a3f37876b627fb5c80ac79d3c614807 (diff) | |
| parent | c2f85df411949653257c5b51f1578a1e40709510 (diff) | |
[MERGE]: Merge with lp:openobject-addons
bzr revid: rpa@tinyerp.com-20101215042654-04ccazkz5v57ml3j
bzr revid: rpa@tinyerp.com-20101216043335-ji5h61dra451cml4
bzr revid: rpa@tinyerp.com-20101220082255-1g3ea50rkjlacwqw
Diffstat (limited to 'addons/document/document.py')
| -rw-r--r-- | addons/document/document.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/addons/document/document.py b/addons/document/document.py index e3d810668b4..7e575f38a37 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -38,7 +38,9 @@ class document_file(osv.osv): def _get_filestore(self, cr): return os.path.join(DMS_ROOT_PATH, cr.dbname) - def _data_get(self, cr, uid, ids, name, arg, context): + def _data_get(self, cr, uid, ids, name, arg, context=None): + if context is None: + context = {} fbrl = self.browse(cr, uid, ids, context=context) nctx = nodes.get_node_context(cr, uid, context={}) # nctx will /not/ inherit the caller's context. Most of @@ -59,7 +61,7 @@ class document_file(osv.osv): # # This code can be improved # - def _data_set(self, cr, uid, id, name, value, arg, context): + def _data_set(self, cr, uid, id, name, value, arg, context=None): if not value: return True fbro = self.browse(cr, uid, id, context=context) @@ -139,7 +141,7 @@ class document_file(osv.osv): if 'name' not in default: name = self.read(cr, uid, [id])[0]['name'] default.update({'name': name + " (copy)"}) - return super(document_file, self).copy(cr, uid, id, default, context) + return super(document_file, self).copy(cr, uid, id, default, context=context) def write(self, cr, uid, ids, vals, context=None): result = False @@ -222,7 +224,7 @@ class document_file(osv.osv): cr.commit() # ? return result - def __get_partner_id(self, cr, uid, res_model, res_id, context): + def __get_partner_id(self, cr, uid, res_model, res_id, context=None): """ A helper to retrieve the associated partner from any res_model+id It is a hack that will try to discover if the mentioned record is clearly associated with a partner record. @@ -246,7 +248,7 @@ class document_file(osv.osv): # rolled back) and then unlink the files. The list wouldn't exist # after we discard the objects ids = self.search(cr, uid, [('id','in',ids)]) - for f in self.browse(cr, uid, ids, context): + for f in self.browse(cr, uid, ids, context=context): # TODO: update the node cache par = f.parent_id storage_id = None |
