diff --git a/addons/website/static/src/snippets/s_countdown/000.js b/addons/website/static/src/snippets/s_countdown/000.js index d83a8f7d227..d9a9ab5dbd4 100644 --- a/addons/website/static/src/snippets/s_countdown/000.js +++ b/addons/website/static/src/snippets/s_countdown/000.js @@ -23,6 +23,17 @@ const CountdownWidget = publicWidget.Widget.extend({ this.endTime = parseInt(this.el.dataset.endTime); this.size = parseInt(this.el.dataset.size); this.display = this.el.dataset.display; + if (!this.display && this.el.dataset.bsDisplay) { + // With the BS5 upgrade script of 16.0, countdowns' data-display may + // have been converted to data-bs-display by mistake. This will fix + // the DOM for good measures, maybe even allowing to remove this + // code in a few years as hopefully all current countdowns will have + // been removed or edited (or when a proper upgrade script in a + // future version of Odoo will be made, if necessary). TODO. + this.display = this.el.dataset.bsDisplay; + delete this.el.dataset.bsDisplay; + this.el.dataset.display = this.display; + } this.layout = this.el.dataset.layout; this.layoutBackground = this.el.dataset.layoutBackground;