Skip to content

Commit af883ca

Browse files
committed
[FIX] util.merge_module: remove old COW views
When a module is merged, all views xmlids are moved to the new module and any duplicated are removed, keeping the new module view per xmlid. When website is also istalled, views would also have COWed copies that have no xmlids, but share the same key. If we update the key for the COW views before renaming the original view's xmlids, the COW views would still be in the db after the removal of the view that is no longer valid, causing issues post upgrades. But if we rename the xmlids first, then unwanted COW views will be removed, and the wanted ones will remain, and then renaming the keys will make sure the wanted ones are correctly associated with the new module. closes #301 Signed-off-by: Christophe Simonis (chs) <[email protected]>
1 parent 637a850 commit af883ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/modules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,8 @@ def _up(table, old, new):
478478

479479
_up("constraint", mod_ids[old], mod_ids[into])
480480
_up("relation", mod_ids[old], mod_ids[into])
481-
_update_view_key(cr, old, into)
482481
_up("data", old, into)
482+
_update_view_key(cr, old, into)
483483
if table_exists(cr, "ir_translation"):
484484
cr.execute("UPDATE ir_translation SET module=%s WHERE module=%s", [into, old])
485485

0 commit comments

Comments
 (0)