summaryrefslogtreecommitdiff
path: root/addons/website_theme_install/models/ir_module_module.py
diff options
context:
space:
mode:
authorSébastien Theys <seb@odoo.com>2018-12-28 12:14:39 +0000
committerSébastien Theys <seb@odoo.com>2019-01-09 12:54:47 +0000
commit2e32cc5aa35044e8f0e7c299c8612a8095d9f479 (patch)
tree2058305fe15a109a2f77fed2d5c89350b6bba166 /addons/website_theme_install/models/ir_module_module.py
parent6b85cbc8444c9de7b042ddd5ca0a236e2cb89d35 (diff)
[FIX] base: remove copies of views when removing module
If a module has a view that has been copied (copy on write, web editor, customize show, manual copy, ...), currently the copied view will not be deleted if the module of the original view is removed. If the copy is not used anymore, it is not a problem (but still polluting the database), but if the copy is still used (ex. it is an inherit of a view still in use), then it will crash if that copy references other data (views, fields, ...) that were in the module that is now removed. Eg. The view `website_sale_comparison.product_add_to_compare` is inheriting `website_sale.product` and calls `website_sale_comparison.add_to_compare`. If the view `website_sale_comparison.product_add_to_compare` is copied (when using the web editor on the product page -> copy on write is making a copy of the `product` view and all its tree), then the product page on website will crash when the module `website_sale_comparison` is removed because `product_add_to_compare` will call the deleted view `add_to_compare`. The solution is to also remove copied views when removing a module. Instead of just using the xml id, we should look for the `key` starting with the module name currently removed, because copied views don't have an external id. task-1920005 PR: #29753
Diffstat (limited to 'addons/website_theme_install/models/ir_module_module.py')
0 files changed, 0 insertions, 0 deletions