[IMP] web: legacy view adapter

Part-of: odoo/odoo#91448
This commit is contained in:
Julien Mougenot
2022-06-07 10:16:11 +02:00
committed by Laurent Smet
parent c08fa433e4
commit bcc5a6efbf
2 changed files with 8 additions and 4 deletions
@@ -332,22 +332,26 @@ export class ViewAdapter extends ActionAdapter {
/**
* @override
*/
async updateWidget() {
async updateWidget(nextProps) {
const shouldUpdateWidget = this.shouldUpdateWidget;
this.shouldUpdateWidget = true;
if (!shouldUpdateWidget) {
return this.magicReload();
}
await this.widget.willRestore();
const options = Object.assign({}, this.props.viewParams, {
const options = {
...this.props.viewParams,
...nextProps.viewParams,
shouldUpdateSearchComponents: true,
});
};
if (!this.magicReload()) {
this.widget.reload(options);
}
return this.magicReload();
}
async renderWidget() {}
/**
* Override to add the state of the legacy controller in the exported state.
*/
@@ -10,7 +10,7 @@ QUnit.module("View service", (hooks) => {
hooks.beforeEach(() => {
const views = {
"take.five,99,list": `<list><field name="display_name" /><list>`,
"take.five,99,list": `<list><field name="display_name" /></list>`,
};
const models = {