From 0a82397da3797b17b242259fc1989548e6394e87 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 22 Oct 2014 11:41:33 +0200 Subject: [PATCH] [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 --- openerp/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/fields.py b/openerp/fields.py index e2a79ad06a0..6081a61e1dc 100644 --- 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