diff --git a/addons/web_editor/__manifest__.py b/addons/web_editor/__manifest__.py index 62c368283f3..f59d5bf2720 100644 --- a/addons/web_editor/__manifest__.py +++ b/addons/web_editor/__manifest__.py @@ -30,7 +30,6 @@ Odoo Web Editor widget. 'web_editor/static/lib/jQuery.transfo.js', 'web/static/lib/nearest/jquery.nearest.js', 'web_editor/static/lib/webgl-image-filter/webgl-image-filter.js', - 'web_editor/static/lib/html2canvas.js', # needed for convert_inline.js 'web_editor/static/lib/DOMPurify.js', # odoo-editor diff --git a/addons/web_editor/static/src/js/backend/convert_inline.js b/addons/web_editor/static/src/js/backend/convert_inline.js index 158d7566100..a6344dee577 100644 --- a/addons/web_editor/static/src/js/backend/convert_inline.js +++ b/addons/web_editor/static/src/js/backend/convert_inline.js @@ -2,6 +2,8 @@ 'use strict'; import { isBlock, rgbToHex } from '../editor/odoo-editor/src/utils/utils'; +import { loadJS } from '@web/core/assets'; + /* global html2canvas */ //-------------------------------------------------------------------------- @@ -631,6 +633,7 @@ async function toInline($editable, cssRules, $iframe) { * @param {Element} editable */ async function flattenBackgroundImages(editable) { + await loadJS('/web_editor/static/lib/html2canvas.js'); for (const backgroundImage of editable.querySelectorAll('*[style*=background-image]')) { if (backgroundImage.parentElement) { // If the image was nested, we removed it already. const canvas = await html2canvas(backgroundImage);