From 3902fa5815d61959ce606d6f4d3293ff7654168e Mon Sep 17 00:00:00 2001 From: Benoit Socias Date: Wed, 2 Dec 2020 10:15:23 +0000 Subject: [PATCH] [FIX] website_blog: not include new tags in existing tags list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit the existing tags list contained the unsaved newly added tags. After this commit the existing tags list does not contain the unsaved newly added tags. Fixes https://github.com/odoo/odoo/issues/62647 closes odoo/odoo#62829 X-original-commit: 8520a3ef14dd1e79ace1dea70eebeffb4f21f0eb Signed-off-by: Jérémy Kersten (jke) --- addons/website_blog/static/src/js/website_blog.editor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/website_blog/static/src/js/website_blog.editor.js b/addons/website_blog/static/src/js/website_blog.editor.js index c826f700004..bc6db04ce34 100644 --- a/addons/website_blog/static/src/js/website_blog.editor.js +++ b/addons/website_blog/static/src/js/website_blog.editor.js @@ -360,7 +360,8 @@ snippetOptions.registry.BlogPostTagSelection = snippetOptions.SnippetOptionWidge } const $select = $(uiFragment.querySelector('we-select[data-name="blog_existing_tag_opt"]')); for (const [key, tag] of Object.entries(this.allTagsByID)) { - if (this.tagIDs.includes(parseInt(key))) { + if (this.tagIDs.includes(parseInt(key)) || this.tagIDs.includes(key)) { + // saved tag keys are numbers, new tag keys are strings continue; } $select.prepend(qweb.render('website_blog.TagSelectItem', {