From 47e566bbc657cf5d316ec7a1f5fd08ab9a9405b2 Mon Sep 17 00:00:00 2001 From: hugues de keyzer Date: Mon, 28 Aug 2023 13:32:44 +0200 Subject: [PATCH] [FIX] fix columns in delete_record_translations() fix filtering of columns in delete_record_translations() for versions >= 16. the loop was wrong as it was changing the size of the list while looping over it. --- openupgradelib/openupgrade.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openupgradelib/openupgrade.py b/openupgradelib/openupgrade.py index 4502f400..ca040ef5 100644 --- a/openupgradelib/openupgrade.py +++ b/openupgradelib/openupgrade.py @@ -2692,9 +2692,7 @@ def delete_record_translations(cr, module, xml_ids, field_list=None): ) cr.execute(query, (record_id,)) checks = cr.fetchall()[0] - for i, (column, check) in enumerate(zip(list_columns, checks)): - if not check: - list_columns.pop(i) + list_columns = [c for c, check in zip(list_columns, checks) if check] if not list_columns: continue columns = ", ".join(list_columns)