From 62c35ebafc78b647d7a5ef8d2e2b61067aaddb12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 30 Nov 2008 20:43:40 +0100 Subject: [PATCH] Fix translation_import for empty translation_ids --- trytond/ir/translation.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/trytond/ir/translation.py b/trytond/ir/translation.py index cccf0ede12..72cee67bb6 100644 --- a/trytond/ir/translation.py +++ b/trytond/ir/translation.py @@ -420,12 +420,13 @@ class Translation(OSV, Cacheable): }, context=ctx) translation_ids += ids - cursor.execute('DELETE FROM ir_translation ' \ - 'WHERE module = %s ' \ - 'AND lang = %s ' \ - 'AND id NOT IN ' \ + if translation_ids: + cursor.execute('DELETE FROM ir_translation ' \ + 'WHERE module = %s ' \ + 'AND lang = %s ' \ + 'AND id NOT IN ' \ '(' + ','.join(['%s' for x in translation_ids]) + ')', - (module, lang) + tuple(translation_ids)) + (module, lang) + tuple(translation_ids)) return len(translation_ids) def translation_export(self, cursor, user, lang, module, context=None):