镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[20.0][FIX] spreadsheet_oca: port the chart integration to the 20.0 data-source API - #13

Merged
dnplkndll merged 3 commits into
20.0-mig-spreadsheet_ocafrom
20.0-fix-spreadsheet_oca-chart-datasource
Nov 7, 2026
Merged

dnplkndll merged 3 commits into
20.0-mig-spreadsheet_ocafrom
20.0-fix-spreadsheet_oca-chart-datasource

Conversation

@dnplkndll

Copy link
Copy Markdown

Three 20.0 chart-integration defects in spreadsheet_oca, found from a production
report of "Cannot find odoo_pie in this registry!" when inserting the Invoices
Analysis chart into a spreadsheet.

All three are the same root cause: 20.0 restructured Odoo charts and the MIG kept the
19.0 shape. odoo_bar / odoo_line / odoo_pie no longer exist as chart types — a
chart now carries the plain o-spreadsheet type and names Odoo as its data source.
Core's own 19.3.10 migration step rewrites stored definitions exactly that way.

Symptom 19.0 → 20.0
Insert from a graph view Cannot find odoo_pie in this registry!, nothing created type: "odoo_pie" → type: "pie" + dataSource: {type: "odoo", …}
Open any chart's side panel getChartOdooMenu is not a function getChartOdooMenu → getChartOdooLink; LINK_ODOO_MENU_TO_CHART → UPDATE_ODOO_LINK_TO_CHART
Edit an Odoo-sourced chart Cannot find odoo in this registry!, panel renders as "Oops!" chartSidePanelComponentRegistry["odoo_*"] → chartDataSourceSidePanelComponentRegistry["odoo"]

Non-mechanical adaptations worth flagging

  • Per-type definition keys. 20.0 charts declare allowedDefinitionKeys and
    deleteInvalidKeys strips anything else silently. verticalAxisPosition and
    axisType are gone from bar/line/pie, stacked is bar/line only, cumulative is
    line only. The definition is now built per type rather than one shape for all three.
  • metaData.mode is deliberately not passed on. ChartDataSource derives the
    GraphModel mode from the chart type, so storing it would be a second source of truth.
  • cumulatedStart moved inside dataSource, while cumulative stayed on the
    definition — matching where core's migration step puts each one.
  • The data-source side panel is a new extension point, not a port. Core ships only
    "range"; the Odoo entry was an Enterprise one. An Odoo chart has no ranges to pick,
    so the section names the view the chart reads from.

Verification

Driven in a browser on Odoo 20.0 against a sanitized copy of production (501 invoices).
Insert from Invoices Analysis in pie, bar and line — each creates, renders live
data, persists, and reopens. Chart side panel opens; the Odoo-menu link reads and
writes. Pivot import unchanged. odoo.loader.findErrors() clean, zero console errors.
Reverting to the unfixed module on the same instance reproduces the reported error
exactly, at ChartPlugin.checkChartDefinition.

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

Inserting a graph view into a spreadsheet raised "Cannot find odoo_pie in
this registry!" and nothing was created.

20.0 removed the `odoo_bar` / `odoo_line` / `odoo_pie` chart types. A chart
now carries the plain o-spreadsheet type and names Odoo as its data source,
which is also where metaData, searchParams, cumulatedStart and actionXmlId
moved -- core's own 19.3.10 migration step rewrites stored definitions the
same way. chartTypeRegistry only knows the plain keys, so the 19.0-shaped
`odoo_${mode}` threw on CREATE_CHART.

metaData.mode is deliberately not passed on: ChartDataSource derives the
GraphModel mode from the chart type.

The rest of the definition is trimmed to each type's allowedDefinitionKeys.
20.0 dropped `verticalAxisPosition` and `axisType` from bar/line/pie, allows
`stacked` only on bar and line, and `cumulative` only on line. Unknown keys
are deleted without a word, so leaving them in only wrote dead state into
the saved payload.

Signed-off-by: Don Kendall <dkendall@ledoweb.com>
Assisted-by: Claude Opus 5
Opening any chart's side panel threw "getChartOdooMenu is not a function".
The "Link to Odoo menu" section is extended into core's Generic, Bar, Line,
Gauge and Scorecard config panels, so this hit every chart, not just the
Odoo-sourced ones.

20.0 generalised the chart-to-menu reference into a chart-to-Odoo link that
can point at either a menu or a data source: the getter is getChartOdooLink
and returns the link record, and the command is UPDATE_ODOO_LINK_TO_CHART
taking `odooLink`, where clearing it is `undefined` rather than a false id.

getChartOdooLink already drops a link whose menu no longer resolves, but it
can also return a "dataSource" link, so the type is checked before reading
odooMenuId.

Signed-off-by: Don Kendall <dkendall@ledoweb.com>
Assisted-by: Claude Opus 5
Editing any Odoo-sourced chart threw "Cannot find odoo in this registry!"
from ChartDataSourceComponent, so the whole chart side panel failed to
render and the dialog was an "Oops!".

20.0 split the chart side panel: the generic part stays keyed by chart type,
while the data-source section is delegated to a component looked up in
chartDataSourceSidePanelComponentRegistry by `dataSource.type`. Core ships
only "range" -- the Odoo entry was an Enterprise one -- so nothing answered
for "odoo".

This is the 20.0 home for what the module used to register as
chartSidePanelComponentRegistry entries under `odoo_bar` / `odoo_pie` / ...,
keys that no longer exist. An Odoo chart has no ranges for the user to pick,
so the section names the view the chart reads from instead.

Signed-off-by: Don Kendall <dkendall@ledoweb.com>
Assisted-by: Claude Opus 5
@dnplkndll
dnplkndll changed the base branch from 20.0 to 20.0-mig-spreadsheet_oca November 7, 2026 03:53
@dnplkndll
dnplkndll merged commit ea57280 into 20.0-mig-spreadsheet_oca Nov 7, 2026
5 checks passed
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.

1 participant