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

[fork-CI] [20.0][MIG] spreadsheet_oca: Migration to 20.0 - #7

Draft
dnplkndll wants to merge 100 commits into
20.0from
20.0-mig-spreadsheet_oca
Draft

dnplkndll wants to merge 100 commits into
20.0from
20.0-mig-spreadsheet_oca

Conversation

@dnplkndll

Copy link
Copy Markdown

Port of spreadsheet_oca from 19.0 to 20.0. Follows the OCA migration guide.

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

etobella and others added 30 commits September 29, 2026 13:09
With this change we are adding an extra layer of security. Without it, any user was able to sniff how all happened using something like:

    const any_spreadsheet_id = 1234;
    const channel = "spreadsheet_oca;spreadsheet.spreadsheet;" + any_spreadsheet_id;
    bus_service.addChannel(channel);
    bus_service.addEventListener("spreadsheet_oca", (message) => /* every revision arrives here */

With the change, we verify the access to the model with a similar logic to `web_editor` fields
commands

Steps:
1. Open spreadsheet
2. Press command Ctrl + Z
3. F5 (refresh browse)

An error occurred:
Operation undefined not found

Because missing key `undoneRevisionId` / `redoneRevisionId` in revisions
data

Solutions:
Save all spreadsheet message in commands field
Currently translated at 100.0% (83 of 83 strings)

Translation: spreadsheet-16.0/spreadsheet-16.0-spreadsheet_oca
Translate-URL: https://translation.odoo-community.org/projects/spreadsheet-16-0/spreadsheet-16-0-spreadsheet_oca/it/
Steps to reproduce the problem:

1. Go to a pivot
2. Group by something on the cols or on the rows
3. Create a spreadsheet with that info

The pivot is imported on the initial state
Currently translated at 100.0% (85 of 85 strings)

Translation: spreadsheet-16.0/spreadsheet-16.0-spreadsheet_oca
Translate-URL: https://translation.odoo-community.org/projects/spreadsheet-16-0/spreadsheet-16-0-spreadsheet_oca/it/
When adding a pivot table to a spreadsheet, it
does not maintain the specified order because the
sortedColumn option is not being completed.

Steps to reproduce the issue:

1. Go to a pivot table
2. Change the default order
3. Add to the spreadsheet

The added table will not have preserved the order.
Ed-Spain and others added 7 commits September 29, 2026 13:09
Currently translated at 100.0% (166 of 166 strings)

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

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

Translation: spreadsheet-18.0/spreadsheet-18.0-spreadsheet_oca
Translate-URL: https://translation.odoo-community.org/projects/spreadsheet-18-0/spreadsheet-18-0-spreadsheet_oca/fr/
…lPanel

SpreadsheetControlPanel extends ControlPanel but overrides
its static components property, losing Dropdown and
DropdownItem that the parent template uses.

This causes "Cannot find the definition of component
Dropdown" when opening a spreadsheet from certain
navigation paths (e.g. from a form view).

Fix: spread parent components before adding custom ones.
Signed-off-by: Don Kendall <dkendall@ledoweb.com>
Assisted-by: Claude Opus 5
* odoo/http.py became the package odoo/http/, which re-exports only a subset: content_disposition now comes from odoo.http.stream
* security/ir.model.access.csv and the six ir.rule records fold into a single security/ir.access.csv; the rules become rows carrying a domain, with per-operation scope (reader r, contributor ru, the rest crud)
* ir.model.access is gone, so the websocket access check uses the record-level has_access()
* 20.0 binary fields hold a BinaryValue, whose .content is the decoded bytes -- where 19.0's field value was the base64 itself. So the base64 hop around spreadsheet_binary_data goes away entirely rather than moving: the field now stores the JSON, read back with BinaryValue.decode and written as BinaryBytes(json...). Keeping the hop round-trips for records this module creates but cannot read one migrated from 19.0, whose stored content is the plain JSON -- every spreadsheet and dashboard carried over fails to open with a UnicodeDecodeError from the double decode
* ir.attachment.datas is gone in 20.0 (a write to it is silently dropped), so the xlsx import reads attachment.raw
* the front end is ported to Owl 3 with odoo/upgrade_code --script owl3-migration, then finished by hand: props schemas via useProps, refs via signal.ref, and `this.` on every component-scoped name in the templates
* the copied 19.0 core control-panel and breadcrumb markup is re-chased against 20.0 core: the Dropdown toggler slot, env.isSmall, switchView, and the list/graph button inherit targets all moved

Signed-off-by: Don Kendall <dkendall@ledoweb.com>
Assisted-by: Claude Opus 5
@dnplkndll
dnplkndll force-pushed the 20.0-mig-spreadsheet_oca branch from ddbebe6 to f8487fc Compare October 1, 2026 23:34
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
…tasource

[20.0][FIX] spreadsheet_oca: port the chart integration to the 20.0 data-source API
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.