[FIX] website: redirect to new page after action create

This commit fixes the behavior of the website app when creating content.
Since commit (1), once a new record was created, it was no longer
redirected to the correct page. Now, this behavior is reintroduced and
works as expected.

(1): https://github.com/odoo/odoo/commit/916a5bebb3e74047a66503ddc59299540c252831

closes odoo/odoo#102959

X-original-commit: 7cfe4523d18989b0273a026000109617bbfb2d13
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
luvi
2022-10-10 19:03:33 +02:00
parent 33def9a755
commit ed57d1cfad
@@ -48,11 +48,22 @@ export const PageControllerMixin = (component) => class extends component {
return;
}
this.actionService.doAction(action, {
onClose: (data) => {
if (data) {
this.website.goToWebsite({path: data.path});
onClose: (infos) => {
if (infos) {
this.website.goToWebsite({ path: infos.path });
}
},
props: {
onSave: (record, params) => {
if (record.resId && params.computePath) {
const path = params.computePath();
this.actionService.doAction({
type: "ir.actions.act_window_close",
infos: { path }
});
}
}
}
});
}
}