Skip to content

Conversation

@fw-bot
Copy link
Collaborator

@fw-bot fw-bot commented Nov 10, 2025

See odoo/odoo#104836

task-2963840

Forward-Port-Of: #15069
Forward-Port-Of: #14984

@robodoo
Copy link
Collaborator

robodoo commented Nov 10, 2025

Pull request status dashboard

@fw-bot
Copy link
Collaborator Author

fw-bot commented Nov 10, 2025

This PR targets saas-18.4 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@fw-bot
Copy link
Collaborator Author

fw-bot commented Nov 10, 2025

@qsm-odoo the next pull request (#15217) is in conflict. You can merge the chain up to here by saying

@robodoo r+

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: f7777d9
@qsm-odoo qsm-odoo force-pushed the saas-18.4-15.0-assets_ignore_active-bso-474175-fw branch from efbd655 to bfdbdd2 Compare November 10, 2025 15:53
@fw-bot
Copy link
Collaborator Author

fw-bot commented Nov 10, 2025

@qsm-odoo this PR has become a normal PR because head updated from efbd655 to bfdbdd2. It must be merged be forward-ported further.

@C3POdoo C3POdoo requested review from a team, HydrionBurst and kmagusiak and removed request for a team November 10, 2025 15:56
Copy link
Contributor

@qsm-odoo qsm-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robodoo
Copy link
Collaborator

robodoo commented Nov 10, 2025

@qsm-odoo linked pull request(s) odoo/odoo#235124 not ready. Linked PRs are not staged until all of them are ready.

robodoo pushed a commit to odoo/odoo that referenced this pull request Nov 10, 2025
*: test_website, base, web_editor, 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 #235124

X-original-commit: ae773c6
Related: odoo/enterprise#99190
Related: odoo/documentation#15215
Related: odoo/design-themes#1177
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
robodoo pushed a commit to odoo/design-themes that referenced this pull request Nov 10, 2025
*: 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

closes #1177

X-original-commit: 69d58de
Related: odoo/odoo#235124
Related: odoo/enterprise#99190
Related: odoo/documentation#15215
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
robodoo pushed a commit that referenced this pull request Nov 10, 2025
Also removes outdated things in the `<template>` tag documentation and
reviews it a bit.

See odoo/odoo#104836

task-2963840

closes #15215

X-original-commit: f7777d9
Related: odoo/odoo#235124
Related: odoo/enterprise#99190
Related: odoo/design-themes#1177
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
@robodoo robodoo closed this Nov 11, 2025
@qsm-odoo qsm-odoo deleted the saas-18.4-15.0-assets_ignore_active-bso-474175-fw branch November 12, 2025 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants