From 332d0707a90b707e2c99894aaf1a508f3045636e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?rqui=C3=B1ones?= <92431809+Ruben1700@users.noreply.github.com> Date: Mon, 9 Sep 2024 16:46:12 +0200 Subject: [PATCH 1/2] Fix Load Translation --- oopgrade/oopgrade.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oopgrade/oopgrade.py b/oopgrade/oopgrade.py index 2babf60..9517e7f 100644 --- a/oopgrade/oopgrade.py +++ b/oopgrade/oopgrade.py @@ -776,7 +776,7 @@ def module_is_installed(cursor, module_name): def load_translation(cursor, lang, name, type, res_id, src, value): - if res_id: + if res_id not in (False, None): insert_sql = """ INSERT INTO ir_translation(lang, name, type, res_id, src, value) VALUES (%(lang)s, %(name)s, %(type)s, %(res_id)s, %(src)s, %(value)s) From 189c42428571104b5ca04b112cb6b8fa85d739d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?rqui=C3=B1ones?= <92431809+Ruben1700@users.noreply.github.com> Date: Mon, 9 Sep 2024 17:12:08 +0200 Subject: [PATCH 2/2] Avoid 0 cast to empty list --- oopgrade/oopgrade.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oopgrade/oopgrade.py b/oopgrade/oopgrade.py index 9517e7f..2a4eece 100644 --- a/oopgrade/oopgrade.py +++ b/oopgrade/oopgrade.py @@ -776,7 +776,7 @@ def module_is_installed(cursor, module_name): def load_translation(cursor, lang, name, type, res_id, src, value): - if res_id not in (False, None): + if res_id is not False and res_id is not None: insert_sql = """ INSERT INTO ir_translation(lang, name, type, res_id, src, value) VALUES (%(lang)s, %(name)s, %(type)s, %(res_id)s, %(src)s, %(value)s)