summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2020-05-26 23:38:58 +0000
committerDenis Ledoux <dle@odoo.com>2020-05-27 10:42:06 +0000
commit4fc0f2c042d1dd97f212056ab2557d0e63e18ed5 (patch)
tree7eab11ae41743d2e041947953ba3dc1e7772d779 /addons/web/static/src
parentfd87ff484399b40004b25f4502c631fd1fc5ea7c (diff)
[FIX] website_theme_install: do not mark theme views as `arch_updated` when loaded from data files
A view is marked as `arch_updated` if `arch` is being written on it and `install_filename` is not in the context: https://github.com/odoo/odoo/blob/7b1a6c00663239fbbab3d8ea5028e0825f4eb0dd/odoo/addons/base/models/ir_ui_view.py#L460-L461 When a view is being updated from a `theme.ir.ui.view` through `_update_records` https://github.com/odoo/odoo/blob/7b1a6c00663239fbbab3d8ea5028e0825f4eb0dd/addons/website_theme_install/models/ir_module_module.py#L29 https://github.com/odoo/odoo/blob/7b1a6c00663239fbbab3d8ea5028e0825f4eb0dd/addons/website_theme_install/models/ir_module_module.py#L92 https://github.com/odoo/odoo/blob/7b1a6c00663239fbbab3d8ea5028e0825f4eb0dd/addons/website_theme_install/models/ir_module_module.py#L208 https://github.com/odoo/odoo/blob/7b1a6c00663239fbbab3d8ea5028e0825f4eb0dd/addons/website_theme_install/models/ir_module_module.py#L168 we can basically consider it comes from a data file, the template is updated, and its copies as well if the copies are "unchanged" and therefore the `arch_updated` should not be set to `True` in such as case, as the goal of this flag is to mark the view as `arch_updated` if it was updated by the user, not from a data file loading. Because the views are marked as `arch_updated`, in 13.0, when updating the theme view "templates" (`theme.ir.ui.view`), the copies are not being updated even if they have been left untouched: https://github.com/odoo/odoo/blob/23511dffb9e3f597a7df9bb834d008f74abb07b8/addons/website_theme_install/models/ir_module_module.py#L165-L166 This is really problematic for upgrades, as the "copies" (the themes views) are not updated according to the latest changes in the xml files, even if the views have been left untouched by the user. For instance, this change in the common theme: odoo/design-themes@29da153784705b48b8c6b99fcdaa5bcbce54f183 is never updated in databases, resulting in the below traceback ``` ValueError: Element '<xpath expr="//div[@data-js='content']">' cannot be located in parent view Fout context: Weergave`s_badge_options` [view_id: 2103, xml_id: n/b, model: n/b, parent_id: 901] load could not load template ValueError: Element '<xpath expr="//div[@data-js='content']">' cannot be located in parent view ``` opw-2255753 closes odoo/odoo#51969 X-original-commit: 614214a08b7e19605228c96fbdef1a60752ba575 Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Diffstat (limited to 'addons/web/static/src')
0 files changed, 0 insertions, 0 deletions