Skip to content

Commit 230c1ff

Browse files
committed
[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.
1 parent 59e6b42 commit 230c1ff

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/util/pg.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,6 @@ def update_m2m_tables(cr, old_table, new_table, ignored_m2ms=()):
14671467
UPDATE ir_model_fields
14681468
SET relation_table = %s
14691469
WHERE relation_table = %s
1470-
AND state = 'manual'
14711470
""",
14721471
[m2m_table, orig_m2m_table],
14731472
)
@@ -1525,7 +1524,6 @@ def update_m2m_tables(cr, old_table, new_table, ignored_m2ms=()):
15251524
SET column1 = %s
15261525
WHERE relation_table = %s
15271526
AND column1 = %s
1528-
AND state = 'manual'
15291527
""",
15301528
[new_col, m2m_table, old_col],
15311529
)
@@ -1535,7 +1533,6 @@ def update_m2m_tables(cr, old_table, new_table, ignored_m2ms=()):
15351533
SET column2 = %s
15361534
WHERE relation_table = %s
15371535
AND column2 = %s
1538-
AND state = 'manual'
15391536
""",
15401537
[new_col, m2m_table, old_col],
15411538
)

0 commit comments

Comments
 (0)