[FIX] fields: selection, do not try to translate label if label is empty
- translate with no source returns first translation for this field, whatever the source - performance
This commit is contained in:
parent
0f31209b79
commit
0a82397da3
|
@ -1261,7 +1261,7 @@ class Selection(Field):
|
||||||
name = "%s,%s" % (self.model_name, self.name)
|
name = "%s,%s" % (self.model_name, self.name)
|
||||||
translate = partial(
|
translate = partial(
|
||||||
env['ir.translation']._get_source, name, 'selection', env.lang)
|
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:
|
else:
|
||||||
return selection
|
return selection
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue