From 1c2c46d96b98e1a1c037378652954d124ff9f034 Mon Sep 17 00:00:00 2001 From: divy-odoo Date: Mon, 12 Jun 2023 11:36:20 +0000 Subject: [PATCH] [FIX] website: dynamic product snippet error on prev/next The issue occurred after the merge of this PR [1]. In that, we removed the dependency on underscore.js and introduced new functions to the qweb engine: `range` and `uniqueId`. The variable named `uniqueId` was clashing with the qweb function `uniqueId()` that's why variable were getting compiled as a function instead of the actual value, which led to unexpected behaviour. This commit renames the uniqueId variable to avoid conflicts with the qweb function `uniqueId()`. [1]: https://github.com/odoo/odoo/pull/123018 task-3357115 closes odoo/odoo#124659 Signed-off-by: Romain Derie (rde) --- .../static/src/snippets/s_dynamic_snippet/000.js | 4 ++-- .../src/snippets/s_dynamic_snippet_carousel/000.xml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/website/static/src/snippets/s_dynamic_snippet/000.js b/addons/website/static/src/snippets/s_dynamic_snippet/000.js index 9ab72363fa0..625097ca0c1 100644 --- a/addons/website/static/src/snippets/s_dynamic_snippet/000.js +++ b/addons/website/static/src/snippets/s_dynamic_snippet/000.js @@ -31,7 +31,7 @@ const DynamicSnippet = publicWidget.Widget.extend({ this.data = []; this.renderedContent = ''; this.isDesplayedAsMobile = config.device.isMobile; - this.uniqueId = uniqueId("s_dynamic_snippet_"); + this.unique_id = uniqueId("s_dynamic_snippet_"); this.template_key = 'website.s_dynamic_snippet.grid'; }, /** @@ -159,7 +159,7 @@ const DynamicSnippet = publicWidget.Widget.extend({ return { chunkSize: chunkSize, data: this.data, - uniqueId: this.uniqueId, + unique_id: this.unique_id, extraClasses: dataset.extraClasses || '', }; }, diff --git a/addons/website/static/src/snippets/s_dynamic_snippet_carousel/000.xml b/addons/website/static/src/snippets/s_dynamic_snippet_carousel/000.xml index 7b6fe0bdb7d..e656e48566a 100644 --- a/addons/website/static/src/snippets/s_dynamic_snippet_carousel/000.xml +++ b/addons/website/static/src/snippets/s_dynamic_snippet_carousel/000.xml @@ -1,17 +1,17 @@ - + Previous - + Next -