From 937872011d56d7cddfe2fc3e51a036dd44c5b699 Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Fri, 27 Sep 2024 13:11:16 -0500 Subject: [PATCH] [FIX] web_editor_class_selector: Avoid errors when custom CSS class is not present Go to the website Open the editor Add text and select it, a traceback is shown --- web_editor_class_selector/README.rst | 2 +- web_editor_class_selector/__manifest__.py | 2 +- web_editor_class_selector/static/description/index.html | 2 +- .../static/src/js/odoo-editor/OdooEditor.esm.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web_editor_class_selector/README.rst b/web_editor_class_selector/README.rst index bb3893eae..bb3bd6532 100644 --- a/web_editor_class_selector/README.rst +++ b/web_editor_class_selector/README.rst @@ -7,7 +7,7 @@ Web editor class selector !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:0b173bde20d95cf982412df8921a0d22a3ba660d940a9ec53c846f5cfa2cbb0a + !! source digest: sha256:87a4e58b89ecc7f911d8e9fad84c60f0b1a024d6564c5040550651ed2be7ff83 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/web_editor_class_selector/__manifest__.py b/web_editor_class_selector/__manifest__.py index b9162a733..3701de15c 100644 --- a/web_editor_class_selector/__manifest__.py +++ b/web_editor_class_selector/__manifest__.py @@ -1,6 +1,6 @@ { "name": "Web editor class selector", - "version": "16.0.1.0.0", + "version": "16.0.1.0.1", "summary": "", "author": "Tecnativa, Odoo Community Association (OCA)", "website": "https://github.com/OCA/web", diff --git a/web_editor_class_selector/static/description/index.html b/web_editor_class_selector/static/description/index.html index bd8b8b9e3..11e2cbcc8 100644 --- a/web_editor_class_selector/static/description/index.html +++ b/web_editor_class_selector/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:0b173bde20d95cf982412df8921a0d22a3ba660d940a9ec53c846f5cfa2cbb0a +!! source digest: sha256:87a4e58b89ecc7f911d8e9fad84c60f0b1a024d6564c5040550651ed2be7ff83 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

This module allows users to create custom CSS class records, which can then be selected and applied directly in the HTML editor. diff --git a/web_editor_class_selector/static/src/js/odoo-editor/OdooEditor.esm.js b/web_editor_class_selector/static/src/js/odoo-editor/OdooEditor.esm.js index 2895276ba..b7cf068f6 100644 --- a/web_editor_class_selector/static/src/js/odoo-editor/OdooEditor.esm.js +++ b/web_editor_class_selector/static/src/js/odoo-editor/OdooEditor.esm.js @@ -11,7 +11,7 @@ import {OdooEditor} from "@web_editor/js/editor/odoo-editor/src/OdooEditor"; patch(OdooEditor.prototype, "web_editor_class_selector.OdooEditor", { _updateToolbar(show) { const res = this._super(show); - if (!this.toolbar) { + if (!this.toolbar || !this.custom_class_css) { return res; } const sel = this.document.getSelection();