Skip to content

[18.0][ADD] mis_builder_chart: display MIS reports as charts - #861

Closed
mileo wants to merge 1 commit into
OCA:18.0from
kmee:18.0-add-mis_builder_chart
Closed

mileo wants to merge 1 commit into
OCA:18.0from
kmee:18.0-add-mis_builder_chart

Conversation

@mileo

@mileo mileo commented Dec 2, 2026

Copy link
Copy Markdown
Member

Summary

New module that draws a MIS report instance as a chart: bar, line, pie, or bars
combined with lines (e.g. cash in and out as bars, balance as a line). The chart is
shown above the table in the preview and in dashboards, and is also added to the
PDF and Excel exports.

mis.report.instance.compute()      (unchanged)
  + "chart" key, built from the rendered cells (cell_id -> kpi, period, subkpi)
      screen: MisReportChart (OWL, Chart.js from web.chartjs_lib)
PDF template
  + SVG drawn in Python from the same data (wkhtmltopdf cannot run Chart.js)
XLSX export
  + native Excel chart below the table, values in a hidden sheet

Settings, Widget tab of the instance: Chart Type, Chart KPIs (empty means all)
and KPIs as Lines. Pie charts show the last column. Account detail rows and
hidden rows are not plotted.

Chart settings

mis_builder is not changed, and the report is not computed again for the screen
and the PDF.

Evidence

  • Before: the instance shows only the table.
    After: Cash Flow report of mis_builder_cash_flow, flows as bars and balance
    as a line.

    Preview:
    Preview

    PDF:
    PDF

  • Tests:

    • test_chart_bar: one series per KPI, text KPI becomes a gap, KPI drawn as line
    • test_chart_pie_selected_kpis: slices are the selected KPIs of the last column
    • test_no_chart: no chart key without a chart type
    • test_exports: the PDF contains the SVG, the XLSX contains a chart

Merge Danger

Door: two-way

New optional module, no change in mis_builder.

Blast Radius: small

Only instances with a chart type are affected. Known limitation: the Excel export
computes the report twice, because _generate_xlsx_one_report does not expose the
matrix; a small hook in mis_builder would avoid it.

Bar, line, pie and combined (bars and lines) charts of the KPIs of a
report instance, above the table in the preview and dashboards, in the
PDF export (drawn as SVG) and in the Excel export (native chart).

Assisted-by: Claude Code
@OCA-git-bot OCA-git-bot added series:18.0 mod:mis_builder_chart Module mis_builder_chart labels Dec 2, 2026
@mileo

mileo commented Dec 2, 2026

Copy link
Copy Markdown
Member Author

cc @sbidoul

@sbidoul

sbidoul commented Dec 2, 2026

Copy link
Copy Markdown
Member

Pretty! Can you move this PR to oca/mis-builder-contrib, though?

@mileo

mileo commented Dec 2, 2026

Copy link
Copy Markdown
Member Author

Moved to OCA/mis-builder-contrib#83, closing this one.

@mileo mileo closed this Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:mis_builder_chart Module mis_builder_chart series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants