summaryrefslogtreecommitdiff
path: root/addons/document/document.py
diff options
context:
space:
mode:
authorParth Gajjar (Open ERP) <pga@tinyerp.com>2013-05-08 18:16:39 +0530
committerParth Gajjar (Open ERP) <pga@tinyerp.com>2013-05-08 18:16:39 +0530
commit2c6aeae9112de0ec0d39f8cdbb0690747ecfaa77 (patch)
tree31ded50792f7f6fc6a9536c4d2d52e914a087c26 /addons/document/document.py
parent4ed6734b82f199952f672a812478b283342125ed (diff)
parent389f4911147b7cf5191b93e025c7b5c39d9e9eb6 (diff)
[MERGE]
bzr revid: pga@tinyerp.com-20130508124639-wfb2mpy15tnzs787
Diffstat (limited to 'addons/document/document.py')
-rw-r--r--addons/document/document.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/addons/document/document.py b/addons/document/document.py
index 9b1fdc1d66b..54f12e204fe 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -137,7 +137,7 @@ class document_file(osv.osv):
It is a hack that will try to discover if the mentioned record is
clearly associated with a partner record.
"""
- obj_model = self.pool.get(res_model)
+ obj_model = self.pool[res_model]
if obj_model._name == 'res.partner':
return res_id
elif 'partner_id' in obj_model._columns and obj_model._columns['partner_id']._obj == 'res.partner':
@@ -422,7 +422,6 @@ class document_directory_content(osv.osv):
tname = ''
if content.include_name:
record_name = node.displayname or ''
- # obj = node.context._dirobj.pool.get(model)
if record_name:
tname = (content.prefix or '') + record_name + (content.suffix or '') + (content.extension or '')
else:
@@ -1296,9 +1295,9 @@ class node_res_dir(node_class):
Note that many objects use NULL for a name, so we should
better call the name_search(),name_get() set of methods
"""
- obj = self.context._dirobj.pool.get(self.res_model)
- if not obj:
+ if self.res_model not in self.context._dirobj.pool:
return []
+ obj = self.context._dirobj.pool[self.res_model]
dirobj = self.context._dirobj
uid = self.context.uid
ctx = self.context.context.copy()
@@ -1333,7 +1332,7 @@ class node_res_dir(node_class):
if self.ressource_tree:
object2 = False
if self.resm_id:
- object2 = dirobj.pool.get(self.res_model).browse(cr, uid, self.resm_id) or False
+ object2 = dirobj.pool[self.res_model].browse(cr, uid, self.resm_id) or False
if obj._parent_name in obj.fields_get(cr, uid):
where.append((obj._parent_name,'=',object2 and object2.id or False))
@@ -1504,7 +1503,7 @@ class node_res_obj(node_class):
ctx = self.context.context.copy()
ctx.update(self.dctx)
directory = dirobj.browse(cr, uid, self.dir_id)
- obj = dirobj.pool.get(self.res_model)
+ obj = dirobj.pool[self.res_model]
where = []
res = []
if name:
@@ -1590,7 +1589,7 @@ class node_res_obj(node_class):
uid = self.context.uid
ctx = self.context.context.copy()
ctx.update(self.dctx)
- res_obj = dirobj.pool.get(self.res_model)
+ res_obj = dirobj.pool[self.res_model]
object2 = res_obj.browse(cr, uid, self.res_id) or False