[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:
Denis Ledoux 2014-10-22 11:41:33 +02:00
parent 0f31209b79
commit 0a82397da3
1 changed files with 1 additions and 1 deletions

View File

@ -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