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:
0f31209
)
[FIX] fields: selection, do not try to translate label if label is empty
author
Denis Ledoux
<dle@odoo.com>
Wed, 22 Oct 2014 09:41:33 +0000
(11:41 +0200)
committer
Denis Ledoux
<dle@odoo.com>
Wed, 22 Oct 2014 09:54:22 +0000
(11:54 +0200)
- translate with no source returns first translation for this field, whatever the source
- performance
openerp/fields.py
patch
|
blob
|
history
diff --git
a/openerp/fields.py
b/openerp/fields.py
index
e2a79ad
..
6081a61
100644
(file)
--- a/
openerp/fields.py
+++ b/
openerp/fields.py
@@
-1261,7
+1261,7
@@
class Selection(Field):
name = "%s,%s" % (self.model_name, self.name)
translate = partial(
env['ir.translation']._get_source, name, 'selection', env.lang)
- return [(value, translate(label)) for value, label in selection]
+ return [(value, translate(label) if label else label) for value, label in selection]
else:
return selection