projects
/
odoo
/
odoo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb97a6d
)
ir.attachment: handle missing name from res_model
author
P. Christeas
<p_christ@hol.gr>
Sun, 27 Jun 2010 20:00:07 +0000
(23:00 +0300)
committer
P. Christeas
<p_christ@hol.gr>
Sun, 27 Jun 2010 20:00:07 +0000
(23:00 +0300)
If, for any reason, the related model cannot return sth through its
name_get, don't bork.
bzr revid: p_christ@hol.gr-
20100627200007
-1aevqw6n4dg2e1pb
bin/addons/base/ir/ir_attachment.py
patch
|
blob
|
history
diff --git
a/bin/addons/base/ir/ir_attachment.py
b/bin/addons/base/ir/ir_attachment.py
index
ba93c95
..
121b6a3
100644
(file)
--- a/
bin/addons/base/ir/ir_attachment.py
+++ b/
bin/addons/base/ir/ir_attachment.py
@@
-94,7
+94,7
@@
class ir_attachment(osv.osv):
if model_object and res_id:
model_pool = self.pool.get(model_object)
res = model_pool.name_get(cr,uid,[res_id],context)
- data[attachment.id] = res[0][1]
+ data[attachment.id] = (res and res[0][1]) or False
else:
data[attachment.id] = False
return data