Skip to content

[fork-CI] [20.0][IMP] spreadsheet_dashboard_purchase_oca: align the dashboard with the 20.0 look - #9

Open
dnplkndll wants to merge 13 commits into
20.0from
20.0-imp-sdpo-ent-parity
Open

dnplkndll wants to merge 13 commits into
20.0from
20.0-imp-sdpo-ent-parity

Conversation

@dnplkndll

@dnplkndll dnplkndll commented Oct 21, 2026 •

Copy link
Copy Markdown

Fork-only branch. Takes the ideas from the enterprise "Purchase & Vendor analysis" dashboard on the 20.0 runbot (raised by @pedrobaeza on OCA#133) and applies the ones that do not require re-authoring the sheet. Not for upstream as-is — none of this is 20.0-forced, so it stays out of the [MIG] PR.

What changed

  • Canvas 1047px → 1000px. Authored to a 1047 canvas, so past ~1280px of viewport the right-hand Amount columns truncated to "Amo…" and the 5th KPI card was clipped. Columns trimmed and the KPI row re-pitched (5 × 190 on a 199 pitch, ending at 995).
  • Chart title. The bar chart had title: "" and relied on a cell heading above it; it now carries its own teal title, and the duplicate cell heading plus its rule are gone. Click-through survives via chartOdooMenusReferences.
  • Currency format on the pivot Amount columns. All 40 were on #,##0, so they rendered 8,971 beside the list-backed Top Orders column's $6,465.50. They now use the [$$]#,##0 format that was already defined and unused. The Top Products quantity column stays on #,##0.
  • KPI cards are white with teal titles instead of tinted blocks, matching core/enterprise.
  • Product and Product Category global filters, wired to all 6 pivots, the list and the chart. purchase.report carries product_id/category_id; the list reaches them through order_line.

Verified

Installed on a clean Odoo 20.0 with demo data and walked at a 1214px viewport (the width the enterprise comparison used). All 5 KPI cards and every Amount header render; the four pivot tables show $; Qty Ordered stays plain. Product filter → pivots, chart, KPIs and the list all recompute. Product Category negative control (Services) → every figure drops to $0/0, proving the wiring rather than assuming it.

Deliberately not done here

The 2×4 KPI grid, an Average order value KPI and the carousel conversion all reflow the sheet — core anchors carouselDataView items to ranges on separate sheets, while this payload draws its tables inline. That is a re-authoring job for the spreadsheet editor, not JSON surgery, and it is what would also close the empty block under Top Orders (the list reserves 25 rows, demo fills ~14).

Supplier service level, on-time deliveries, late receipts and vendor lead time need purchase_stock models, so they belong in spreadsheet_dashboard_purchase_stock_oca, not here.

AI-assisted (Claude Code); every change reviewed, tested, and owned by the author.


Second commit — the carousel rebuild (ca4bd1c)

This is the re-authoring I had deferred. It needed three things to happen together:

  • Payload migrated 18.5.10 → 19.3.10, replaying o-spreadsheet's own steps (19.1.1, 19.3.10) in Python. Without it, step 19.3.10 would rename the spilling ODOO.LIST this commit introduces into ODOO.LIST.VALUE and break it.
  • Each ranking table moved to its own sheet behind a single spilling formula (=PIVOT(id,10,FALSE,FALSE) / =ODOO.LIST(1,10)), which is how core sizes a table to its data. This is what finally removes the empty block under Top Orders — not a row-count tweak.
  • The Dashboard sheet now holds only figures, as core's does: a 3×2 KPI grid (with a new Avg order value card computed from the existing Data sheet) and carousel cards wrapping the chart and every table, each with its own title and expand control.

Supporting changes that the render caught:

  • Pivots renamed Purchase Analysis by … → Country / Vendor / Buyer / Product, because a spilled pivot's first header cell is the pivot name (core names its display pivots the same way).
  • origin declared on the list, otherwise the Source column silently disappears — the old table pulled it with a per-cell formula the list definition never declared.
  • Column counts derived from each pivot's measures rather than assumed: Product carries three measures where the others carry two, and hardcoding three columns cut its amount off.
  • Currency format applied only to the pivot amount columns; the list's amount_untaxed is monetary and formats itself, and overriding it rounded $6,465.50 to $6,466.

Verified on a clean 20.0 with demo data at 1214px and 1100px, before/after side by side.

Known deviations from enterprise

  • 6 KPIs in a 3×2 grid, not 8 in 2×4 — the two missing cards (supplier service level, on-time deliveries) are stock-derived and belong in spreadsheet_dashboard_purchase_stock_oca.
  • The table carousels are data-view only, so the per-table click-through that the old cell headings carried is gone. Enterprise's ranking carousels behave the same way; the chart keeps its click-through via odooLinkReferences.

Odoo and others added 13 commits September 28, 2026 11:29
Copied as is from Odoo 17.0 branch. Later commits will do the needed
changes.
Currently translated at 100.0% (27 of 27 strings)

Translation: spreadsheet-18.0/spreadsheet-18.0-spreadsheet_dashboard_purchase_oca
Translate-URL: https://translation.odoo-community.org/projects/spreadsheet-18-0/spreadsheet-18-0-spreadsheet_dashboard_purchase_oca/it/
Currently translated at 100.0% (27 of 27 strings)

Translation: spreadsheet-18.0/spreadsheet-18.0-spreadsheet_dashboard_purchase_oca
Translate-URL: https://translation.odoo-community.org/projects/spreadsheet-18-0/spreadsheet-18-0-spreadsheet_dashboard_purchase_oca/fr/
Currently translated at 100.0% (31 of 31 strings)

Translation: spreadsheet-19.0/spreadsheet-19.0-spreadsheet_dashboard_purchase_oca
Translate-URL: https://translation.odoo-community.org/projects/spreadsheet-19-0/spreadsheet-19-0-spreadsheet_dashboard_purchase_oca/it/
Signed-off-by: Don Kendall <dkendall@ledoweb.com>
Assisted-by: Claude Code
* data/dashboards.xml: payload loads with type="bytes", not type="base64".
* vendors_dashboard.json: Dashboard sheet backgroundColor #F9FAFB, as core.

Signed-off-by: Don Kendall <dkendall@ledoweb.com>
Assisted-by: Claude Opus 5
…e 20.0 look

Fits the canvas to 1000px, gives the chart its own title, formats the pivot
Amount columns as currency and adds Product and Product Category filters.

Assisted-by: Claude Opus 5
…rousels

Moves each table to its own sheet behind a spilling formula, wraps the chart
and tables in carousel cards, and lays the KPIs out as a grid with a new
average order value card.

Assisted-by: Claude Opus 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants