Skip to content
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

[FIX] theme_*: register unused configurator snippets #751

Closed

Conversation

bso-odoo
Copy link
Collaborator

When shapes were extracted to configurator snippets in 1, some configurator-specific snippets were created that do not appear on pages of the specific theme.
Because in 2 the call to _generate_primary_snippet_templates is done on a full list of themes instead of only the installed ones, the problem was not noticed: if any theme defines a block, it's website-side configurator-specific template is generated.
This is not the case during an upgrade: the templates are generated only for the installed themes. Because of this some "useless" configurator templates trigger an error when importing their XML definition because their parent template does not exist.

This commit fixes this by adding those templates in a pseudo page _ in the configurator_snippets entry of each theme's manifest. In master, the templates will be removed instead.

When shapes were extracted to configurator snippets in [1], some
configurator-specific snippets were created that do not appear on pages
of the specific theme.
Because in [2] the call to `_generate_primary_snippet_templates` is done
on a full list of themes instead of only the installed ones, the problem
was not noticed: if any theme defines a block, it's website-side
configurator-specific template is generated.
This is not the case during an upgrade: the templates are generated only
for the installed themes. Because of this some "useless" configurator
templates trigger an error when importing their XML definition because
their parent template does not exist.

This commit fixes this by adding those templates in a pseudo page `_` in
the `configurator_snippets` entry of each theme's manifest.
In master, the templates will be removed instead.

[1]: odoo@d206c11
[2]: odoo/odoo@928eeca#diff-f49a1e9eda23df9f1d48121ba376a5fabafe70ea18b29d4eab23d737e5d4eeb6R446
@robodoo
Copy link
Collaborator

robodoo commented Nov 29, 2023

Copy link
Contributor

@rdeodoo rdeodoo 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 Dec 1, 2023

@bso-odoo @rdeodoo linked pull request(s) odoo/odoo#144222 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 Dec 1, 2023
During upgrades, customization modules are defined in the database but
their codebase is not in the addons path.
Because of this, when running an upgrade the manifest of such modules
does not exist which makes `_generate_primary_snippet_templates` fail
because it cannot locate some default keys.

This commit adapts the access to the manifest in order to use a default
value in case the manifest is not available.

closes #144222

Related: odoo/design-themes#751
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
robodoo pushed a commit that referenced this pull request Dec 1, 2023
When shapes were extracted to configurator snippets in [1], some
configurator-specific snippets were created that do not appear on pages
of the specific theme.
Because in [2] the call to `_generate_primary_snippet_templates` is done
on a full list of themes instead of only the installed ones, the problem
was not noticed: if any theme defines a block, it's website-side
configurator-specific template is generated.
This is not the case during an upgrade: the templates are generated only
for the installed themes. Because of this some "useless" configurator
templates trigger an error when importing their XML definition because
their parent template does not exist.

This commit fixes this by adding those templates in a pseudo page `_` in
the `configurator_snippets` entry of each theme's manifest.
In master, the templates will be removed instead.

[1]: d206c11
[2]: odoo/odoo@928eeca#diff-f49a1e9eda23df9f1d48121ba376a5fabafe70ea18b29d4eab23d737e5d4eeb6R446

closes #751

Related: odoo/odoo#144222
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
@robodoo robodoo closed this Dec 1, 2023
@fw-bot
Copy link

fw-bot commented Dec 5, 2023

@bso-odoo @rdeodoo this pull request has forward-port PRs awaiting action (not merged or closed):

2 similar comments
@fw-bot
Copy link

fw-bot commented Dec 6, 2023

@bso-odoo @rdeodoo this pull request has forward-port PRs awaiting action (not merged or closed):

@fw-bot
Copy link

fw-bot commented Dec 7, 2023

@bso-odoo @rdeodoo this pull request has forward-port PRs awaiting action (not merged or closed):

@fw-bot fw-bot deleted the 17.0-fix_configurator_templates-bso branch December 15, 2023 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants