Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][ADD] mis_builder: add option on report instance to drilldown in popup #621

Draft
wants to merge 2 commits into
base: 16.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions mis_builder/models/mis_report_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,9 @@ def _compute_pivot_date(self):
string="Filter box search view",
help="Search view to customize the filter box in the report widget.",
)
drilldown_open_in_pop_up = fields.Boolean(
string="Drilldown in a pop up window",
)

@api.depends("report_id.move_lines_source")
def _compute_widget_search_view_id(self):
Expand Down Expand Up @@ -914,15 +917,19 @@ def drilldown(self, arg):
)
domain.extend(period._get_additional_move_line_filter())
views = self._get_drilldown_model_views(period.source_aml_model_name)
# Keep all context for hook
context = dict(self.env.context)
context.update({"active_test": False})

return {
"name": self._get_drilldown_action_name(arg),
"domain": domain,
"type": "ir.actions.act_window",
"res_model": period.source_aml_model_name,
"views": [[False, view] for view in views],
"view_mode": ",".join(view for view in views),
"target": "current",
"context": {"active_test": False},
"target": "new" if self.drilldown_open_in_pop_up else "current",
"context": context,
}
else:
return False
Expand Down
5 changes: 5 additions & 0 deletions mis_builder/views/mis_report_instance.xml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@
<field name="widget_show_pivot_date" />
</group>
</page>
<page string="Drilldown">
<group name="drilldown">
<field name="drilldown_open_in_pop_up" />
</group>
</page>
</notebook>
</sheet>
</form>
Expand Down
Loading