[FIX] website: properly rerender dynamic snippet

Before this commit, changing a filter in the dynamic snippet could
cause errors because the option wasn't awaiting an asynchronous
call.

This commit fixes that by using the same mechanism used in the
s_website_form snippet, relegating the rerenderXML call to updateUI

task-2654924

closes odoo/odoo#80867

X-original-commit: 8a4391a7d6e6988da7b62f6caa91e49c831da774
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
Arthur Detroux (ard)
2021-12-03 18:24:07 +00:00
parent 51c3a69304
commit ac8d83cc12
@@ -62,6 +62,20 @@ const dynamicSnippetOptions = options.Class.extend({
// Public
//--------------------------------------------------------------------------
/**
* See from updateUI in s_website_form
*
* @override
*/
async updateUI() {
if (this.rerender) {
this.rerender = false;
await this._rerenderXML();
return;
}
await this._super(...arguments);
},
/**
* @override
*/
@@ -252,7 +266,7 @@ const dynamicSnippetOptions = options.Class.extend({
_filterUpdated: function (filter) {
if (filter && this.currentModelName !== filter.model_name) {
this.currentModelName = filter.model_name;
this._rerenderXML();
this.rerender = true;
}
},
/**