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:
cb55107
)
[FIX] fields: convert_to_read, handle missing many2one foreign keys
author
Denis Ledoux
<dle@odoo.com>
Tue, 16 Sep 2014 10:28:32 +0000
(12:28 +0200)
committer
Denis Ledoux
<dle@odoo.com>
Tue, 16 Sep 2014 10:29:37 +0000
(12:29 +0200)
openerp/fields.py
patch
|
blob
|
history
diff --git
a/openerp/fields.py
b/openerp/fields.py
index
2234528
..
0104302
100644
(file)
--- a/
openerp/fields.py
+++ b/
openerp/fields.py
@@
-1368,7
+1368,11
@@
class Many2one(_Relational):
# evaluate name_get() as superuser, because the visibility of a
# many2one field value (id and name) depends on the current record's
# access rights, and not the value's access rights.
- return value.sudo().name_get()[0]
+ try:
+ return value.sudo().name_get()[0]
+ except MissingError:
+ # Should not happen, unless the foreign key is missing.
+ return False
else:
return value.id