Skip to content

Commit 0e13298

Browse files
committed
[FIX] website: include website_id when loading snippets
Steps to reproduce: - Create a custom snippet. - Switch website and enter in edit mode. -> Problem: the custom snippet is present in edit mode on the second website while it should only be available on the first one. The commit adds back the `website_id` information when loading the snippets. The information was missing since [the website refactoring]. Related to task-4367641 [the website refactoring]: odoo@9fe45e2 closes odoo#218206 X-original-commit: 18144be Signed-off-by: Francois Georis (fge) <[email protected]>
1 parent 0ec45cf commit 0e13298

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

addons/website/static/src/client_actions/website_preview/website_builder_action.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ export class WebsiteBuilderClientAction extends Component {
137137
loadBundle("website.website_builder_assets").then(() => {
138138
this.env.services["html_builder.snippets"].reload({
139139
lang: this.websiteService.currentWebsite?.default_lang_id.code,
140+
website_id: this.websiteService.currentWebsite?.id,
140141
});
141142
});
142143
}

addons/website/static/tests/tours/snippet_cache_across_websites.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ registerWebsitePreviewTour('snippet_cache_across_websites', {
1111
}, () => [
1212
{
1313
content: "Click on the Custom category block",
14-
trigger: "#oe_snippets .oe_snippet[name='Custom'].o_we_draggable .oe_snippet_thumbnail",
14+
trigger: ".o-website-builder_sidebar .o_snippet[name='Custom'].o_draggable .o_snippet_thumbnail_area",
1515
run: "click",
1616
},
1717
{
@@ -29,6 +29,6 @@ registerWebsitePreviewTour('snippet_cache_across_websites', {
2929
...clickOnEditAndWaitEditMode(),
3030
{
3131
content: "Check that the custom snippet category is not here",
32-
trigger: "#oe_snippets:not(:has(.oe_snippet[name='Custom']))",
32+
trigger: ".o-website-builder_sidebar:not(:has(.o_snippet[name='Custom']))",
3333
},
3434
]);

addons/website/tests/test_ui.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,6 @@ def test_22_website_gray_color_palette(self):
494494
def test_23_website_multi_edition(self):
495495
self.start_tour('/@/', 'website_multi_edition', login='admin')
496496

497-
# TODO master-mysterious-egg fix error
498-
@unittest.skip("prepare mysterious-egg for merging")
499497
def test_24_snippet_cache_across_websites(self):
500498
default_website = self.env.ref('website.default_website')
501499
website = self.env['website'].create({

0 commit comments

Comments
 (0)