From 230c1ff6191c6d6da5c686772b9e2a7ea9fef01a Mon Sep 17 00:00:00 2001 From: Jinane Maksoud Date: Mon, 20 Oct 2025 14:39:25 +0200 Subject: [PATCH] [FIX] pg: rename m2m field meta data When renaming a model and updating related m2m fields, the relation table and its columns are renamed but only manual fields meta data is updated, assuming that base fields will be updated when the module loads. The custom modules meta data should also be updated if the tables were updated. --- src/util/pg.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/util/pg.py b/src/util/pg.py index 4ab4fb0bf..540961b54 100644 --- a/src/util/pg.py +++ b/src/util/pg.py @@ -1467,7 +1467,6 @@ def update_m2m_tables(cr, old_table, new_table, ignored_m2ms=()): UPDATE ir_model_fields SET relation_table = %s WHERE relation_table = %s - AND state = 'manual' """, [m2m_table, orig_m2m_table], ) @@ -1525,7 +1524,6 @@ def update_m2m_tables(cr, old_table, new_table, ignored_m2ms=()): SET column1 = %s WHERE relation_table = %s AND column1 = %s - AND state = 'manual' """, [new_col, m2m_table, old_col], ) @@ -1535,7 +1533,6 @@ def update_m2m_tables(cr, old_table, new_table, ignored_m2ms=()): SET column2 = %s WHERE relation_table = %s AND column2 = %s - AND state = 'manual' """, [new_col, m2m_table, old_col], )