From ff43a1fd6b9744505f1056428e7e01ac3dd39019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 20 Sep 2013 18:33:35 +0200 Subject: [PATCH] Better default language for the export translation wizard Use the domain of the field to search for the current language. --- trytond/ir/translation.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/trytond/ir/translation.py b/trytond/ir/translation.py index 00b23c3570..7a1a765dfa 100644 --- a/trytond/ir/translation.py +++ b/trytond/ir/translation.py @@ -1552,15 +1552,13 @@ class TranslationExportStart(ModelView): ('state', 'in', ['installed', 'to upgrade', 'to remove']), ]) - @staticmethod - def default_language(): + @classmethod + def default_language(cls): Lang = Pool().get('ir.lang') code = Transaction().context.get('language', False) + domain = [('code', '=', code)] + cls.language.domain try: - lang, = Lang.search([ - ('code', '=', code), - ('translatable', '=', True), - ], limit=1) + lang, = Lang.search(domain, limit=1) return lang.id except ValueError: return None