From 71a76608c58208e582d454b4a70b0c1ce1d8fe9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 13 Apr 2012 21:35:38 +0200 Subject: [PATCH] Fix translation of empty value in selection source must be compared to None instead of boolean. issue2541 --- trytond/ir/translation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trytond/ir/translation.py b/trytond/ir/translation.py index 54c25e6923..1a0ebeec07 100644 --- a/trytond/ir/translation.py +++ b/trytond/ir/translation.py @@ -328,7 +328,7 @@ class Translation(ModelSQL, ModelView, Cacheable): return trans cursor = Transaction().cursor - if source: + if source is not None: cursor.execute('SELECT value ' 'FROM ir_translation ' 'WHERE lang = %s ' @@ -385,7 +385,7 @@ class Translation(ModelSQL, ModelView, Cacheable): else: res[(name, ttype, lang, source)] = None self.add((lang, ttype, name, source), None) - if source: + if source is not None: clause += [('(lang = %s ' \ 'AND type = %s ' \ 'AND name = %s ' \