Skip to content

[19.0][IMP] mis_builder: Preserve filters and pivot date on report drilldown - #826

Closed
petrus-v wants to merge 1 commit into
OCA:19.0from
petrus-v:19.0-imp-breadcrumb-history
Closed

petrus-v wants to merge 1 commit into
OCA:19.0from
petrus-v:19.0-imp-breadcrumb-history

Conversation

@petrus-v

Copy link
Copy Markdown
Contributor

When navigating away from a MIS report via drilldown links and returning using the breadcrumb, active search filters and pivot date were lost.

This commit preserves the report widget state across view navigation:

  • Register useSetupAction in MisReportWidget to export search model state and pivot date when leaving the controller.
  • Forward props.state to env.config.state in FormController so that restored controller state is accessible during component willStart.
  • Hydrate searchModel and pivot_date upon view restoration.
  • Add JS tour mis_report_drilldown_tour and HttpCase test TestMisReportWidgetTour to validate filter preservation end-to-end.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @sbidoul,
some modules you are maintaining are being modified, check this out!

@petrus-v
petrus-v force-pushed the 19.0-imp-breadcrumb-history branch from aad1fc1 to 7637e7d Compare August 20, 2026 15:41
@petrus-v petrus-v changed the title [IMP] mis_builder: Preserve filters and pivot date on report drilldown [19.0][IMP] mis_builder: Preserve filters and pivot date on report drilldown Aug 20, 2026

@AnizR AnizR left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM
Tested on runboat, seems to work fine.

I realised that using browser's back arrow doesn't work when being on mis report instances but this is already the case on 19.0's branch.

Comment on lines +22 to +23
if (this.props.state) {
this.env.config.state = this.props.state;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this will have impact on other model's forms?

@petrus-v petrus-v Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I miss your comment yesterday, good point, you are right this will apply on any forms 🤔... we should restricted it to mis.report.instance or extend the FormController and use the new form view. I'd like to try the second approach

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've give a try by extending FormController but it seems odoo do not take care of js_class while coming back from drilldown instanciate a FormController... so I rollback for a simplest version

When navigating away from a MIS report via drilldown links and returning
using the breadcrumb, active search filters and pivot date were lost.

This commit preserves the report widget state across view navigation:
- Register `useSetupAction` in `MisReportWidget` to export search model
  state and pivot date when leaving the controller.
- Forward `props.state` to `env.config.state` in `FormController` so that
  restored controller state is accessible during component `willStart`.
- Hydrate `searchModel` and `pivot_date` upon view restoration.
- Add JS tour `mis_report_drilldown_tour` and HttpCase test
  `TestMisReportWidgetTour` to validate filter preservation end-to-end.

Assisted-by: Gemini 3.6 Flash
@petrus-v
petrus-v force-pushed the 19.0-imp-breadcrumb-history branch from 7637e7d to f216298 Compare August 22, 2026 14:38
@petrus-v

Copy link
Copy Markdown
Contributor Author

I'm closing this PR as changed is included in #827

@petrus-v petrus-v closed this Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants