From 03763da5bf8481dabe4290292e6589ddb0e6dbf3 Mon Sep 17 00:00:00 2001 From: Samuel Degueldre Date: Wed, 27 Apr 2022 09:13:27 +0000 Subject: [PATCH] [IMP] web: update owl to version 2.0.0-beta-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Release notes: https://github.com/odoo/owl/releases/tag/v2.0.0-beta-7 closes odoo/odoo#89937 X-original-commit: b0a807ff5ea36b08ec027ac19ac6d0b9ee360ab8 Signed-off-by: Géry Debongnie Signed-off-by: Samuel Degueldre --- addons/web/static/lib/owl/owl.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/addons/web/static/lib/owl/owl.js b/addons/web/static/lib/owl/owl.js index a417b9a38b7..fc518ec8f1d 100644 --- a/addons/web/static/lib/owl/owl.js +++ b/addons/web/static/lib/owl/owl.js @@ -5313,13 +5313,19 @@ } this.helpers = makeHelpers(this.getTemplate.bind(this)); } - addTemplate(name, template, options = {}) { - if (name in this.rawTemplates && !options.allowDuplicate) { - throw new Error(`Template ${name} already defined`); + addTemplate(name, template) { + if (name in this.rawTemplates) { + const rawTemplate = this.rawTemplates[name]; + const currentAsString = typeof rawTemplate === "string" ? rawTemplate : rawTemplate.outerHTML; + const newAsString = typeof template === "string" ? template : template.outerHTML; + if (currentAsString === newAsString) { + return; + } + throw new Error(`Template ${name} already defined with different content`); } this.rawTemplates[name] = template; } - addTemplates(xml, options = {}) { + addTemplates(xml) { if (!xml) { // empty string return; @@ -5327,7 +5333,7 @@ xml = xml instanceof Document ? xml : parseXML(xml); for (const template of xml.querySelectorAll("[t-name]")) { const name = template.getAttribute("t-name"); - this.addTemplate(name, template, options); + this.addTemplate(name, template); } } getTemplate(name) { @@ -5606,9 +5612,9 @@ See https://github.com/odoo/owl/blob/${hash}/doc/reference/app.md#configuration Object.defineProperty(exports, '__esModule', { value: true }); - __info__.version = '2.0.0-beta-6'; - __info__.date = '2022-04-19T10:09:08.600Z'; - __info__.hash = '41f1262'; + __info__.version = '2.0.0-beta-7'; + __info__.date = '2022-04-27T09:08:50.320Z'; + __info__.hash = '0cd66c8'; __info__.url = 'https://github.com/odoo/owl';