-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[IMP] developer: explain the new <asset> tag added as a fix #15239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@qsm-odoo while this was properly forward-ported, at least one co-dependent PR (odoo/odoo#235226, odoo/enterprise#99233, odoo/design-themes#1179) did not succeed. You will need to fix it before this can be merged. Both this PR and the others will need to be approved via More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port |
Also removes outdated things in the `<template>` tag documentation and reviews it a bit. See odoo/odoo#104836 task-2963840 X-original-commit: db6ceff
72b2380 to
1fb490a
Compare
qsm-odoo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robodoo r+
|
@qsm-odoo linked pull request(s) odoo/enterprise#99233, odoo/odoo#235226 not ready. Linked PRs are not staged until all of them are ready. |
*: test_website, base, website, website_blog, website_event,
website_event_track, website_payment, website_sale, test_assetsbundle
Before this commit when a module was updated all ir.asset records were
reset to their defined `active` state, if defined.
This causes assets related to old snippet versions to be made inactive
even if those old snippet versions are used inside existing pages.
It used to work when the activation of assets was made through view
inheritance because when views are defined through a `<template>` tag,
the `active` attribute is in fact ignored during updates since [1],
except for new records since [2].
This commit introduces an `<asset>` tag in the XML import format.
It is an alias of `<record ... model="ir.asset">` with the additional
feature that it avoids taking the `active` field into account during
updates for existing `ir_asset` records, just like `<template>` if the
`active` field is mentioned as attribute of the tag.
We then rely on the `website_disable_unused_snippets_assets` cron to
properly disable any unused asset at a later stage (note that the bug
being fixed here was mitigated by the fact that cron also re-enabled
assets which were disabled by mistake... but that might happen only a
few days later).
Another approach was to overload `_load_records_write` in `base`'s
`ir_asset.py` to avoid taking the `active` field into account when
updating records:
```py
def _load_records_write(self, values):
values.pop('active', None)
super()._load_records_write(values)
```
But this is not as stable because it changes the way `ir.asset` records
are imported when the `<record>` tag is used. In the end we chose to be
consistent and do exactly the same as `<template>`, as this also allows
more and should be entirely stable.
[1]: 2d296cb#diff-175c28787c272a219b9275f79262a48af9aa029e718f45077fd609737559e84eR803-R804
[2]: f1c70d4#diff-175c28787c272a219b9275f79262a48af9aa029e718f45077fd609737559e84eR801-R804
task-2963840
closes #235226
X-original-commit: 906ae8a
Related: odoo/enterprise#99233
Related: odoo/documentation#15239
Related: odoo/design-themes#1179
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
*: theme_anelusia, theme_artists, theme_avantgarde, theme_aviato, theme_beauty, theme_bewise, theme_bistro, theme_bookstore, theme_buzzy, theme_clean, theme_cobalt, theme_enark, theme_graphene, theme_kea, theme_kiddo, theme_loftspace, theme_monglia, theme_nano, theme_notes, theme_odoo_experts, theme_orchid, theme_paptic, theme_real_estate, theme_test_custo, theme_treehouse, theme_vehicle, theme_yes, theme_zap See community commit for details. task-2963840 X-original-commit: f651006 Part-of: #1179 Related: odoo/odoo#235226 Related: odoo/enterprise#99233 Related: odoo/documentation#15239 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Co-authored-by: qsm-odoo <qsm@odoo.com>
Commit [1] made a mistake when moving compatibility assets: it created a XML file for them but forgot to link it in the manifest, making it be dead code. This was done in version 14.X. Upgrade scripts might have treated the existing file additions (via views) as custom code and converted them but none should be linked to this code anymore. It was compatibility code meant to be removed at some point anyway. Let's just remove the file, and their related asset files. Note that an ir.asset mentioned `/static/src/old_snippets/s_animated_boxes/000.js` but that file was already not even present in the repo (anymore?). [1]: 84ba083 Related to task-2963840 Also see task-3696867 closes #1179 Related: odoo/odoo#235226 Related: odoo/enterprise#99233 Related: odoo/documentation#15239 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Also removes outdated things in the `<template>` tag documentation and reviews it a bit. See odoo/odoo#104836 task-2963840 closes #15239 X-original-commit: db6ceff Related: odoo/odoo#235226 Related: odoo/enterprise#99233 Related: odoo/design-themes#1179 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>

See odoo/odoo#104836
task-2963840
Forward-Port-Of: #15217
Forward-Port-Of: #14984