-
-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] mis_builder: preserve the filters when navigating back from dri…
…ll-down Prior to this commit the state of the searchModel was lost when navigating back from a drill-down. This commit uses the globalState in order to store and restore the state of the searchModlel. The use of a SubEnv allows not having to pass props up to the widget, which would have required overriding the renderer, the compiler and field.
- Loading branch information
Laurent Stukkens
committed
Dec 28, 2023
1 parent
9a8add9
commit 7c2fc76
Showing
5 changed files
with
64 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
mis_builder/static/src/views/form/mis_report_form_controller.esm.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** @odoo-module */ | ||
|
||
import {FormController} from "@web/views/form/form_controller"; | ||
import {useSubEnv} from "@odoo/owl"; | ||
|
||
export class MisReportFormController extends FormController { | ||
setup() { | ||
super.setup(); | ||
useSubEnv({ | ||
misReportSearchModelState: | ||
this.props.globalState && | ||
this.props.globalState.misReportSearchModelState, | ||
}); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
mis_builder/static/src/views/form/mis_report_form_view.esm.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** @odoo-module **/ | ||
|
||
import {MisReportFormController} from "@mis_builder/views/form/mis_report_form_controller.esm"; | ||
import {formView} from "@web/views/form/form_view"; | ||
import {registry} from "@web/core/registry"; | ||
|
||
// The view to use when mounting `mis_report_widget` widget in order to preserve the | ||
// filters when returning from the drill-down views. | ||
export const misReportFormView = { | ||
...formView, | ||
Controller: MisReportFormController, | ||
}; | ||
|
||
registry.category("views").add("mis_report_form_view", misReportFormView); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters