Skip to content

[19.0][MIG] spreadsheet_oca: Migration to 19.0#122

Open
chrisandrewmann wants to merge 100 commits into
OCA:19.0from
chrisandrewmann:19.0-mig-spreadsheet_oca
Open

[19.0][MIG] spreadsheet_oca: Migration to 19.0#122
chrisandrewmann wants to merge 100 commits into
OCA:19.0from
chrisandrewmann:19.0-mig-spreadsheet_oca

Conversation

@chrisandrewmann

@chrisandrewmann chrisandrewmann commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Migration of spreadsheet_oca to 19.0

Supersedes #109 by @mpiko. That PR did the bulk of the groundwork and is carried over here. This branch was rebuilt from the current 18.0 branch, previous migration had drifted from 18.0 and lost several merged features (details below).
There were also various issues still outstanding and resolved here.
Relates to #73.

Why this needed a rebuild

While reviewing #109 I found that its migration had overwritten several files with older copies. The commits were present in git ancestry, but the file contents had regressed. The clearest signal was views/spreadsheet_spreadsheet.xml: 240 lines on 18.0, 96 lines on that branch.

Features merged into 18.0 but were absent included:

This branch starts from the 18.0 preserving all original authorship, with the 19.0 work applied on top.

Carried over from #109 (@mpiko)

  • res.groups: category_id and users no longer usable as they were in 18.0
  • groups_idgroup_ids renames in ir.rule domains and on ir.ui.menu
  • _sql_constraintsmodels.Constraint, and the constraint attribute name must start with an underscore
  • inheritable-method-lambda fix on the tag colour default
  • _t()self.env._()
  • globalFiltersFieldMatchersglobalFieldMatchingRegistry, with getters as the first argument to every matcher method
  • RELATIVE_DATE_RANGE_TYPESRELATIVE_PERIODS
  • loadSpreadsheetDependenciesloadBundle("spreadsheet.o_spreadsheet")
  • Removal of the duplicate topbar file / settings registrations now provided by core
  • getTableStructure() split into getCollapsedTableStructure() / getExpandedTableStructure()
  • web.ListView.Buttons is an empty template in 19.0, so the tree view's xpath-based inheritance had no anchor

Additional fixes made - Found whilst testing locally

Charts

  • 19.0 separates figure ids from chart ids. ChartPanel / ChartTypePicker props now carry chartId only, so every this.props.figureId resolved to undefined and the chart menu selector silently did nothing. All 17 references updated across odoo_panels, chart_panels and chart_panel.
  • UPDATE_CHART now takes definition, chartId, figureId and sheetId (resolved via getFigureIdFromChartId / getFigureSheetId) instead of id.
  • CREATE_CHART now takes figureId, chartId and col/row/offset instead of id and position. The old payload was rejected, so inserting a graph produced an empty spreadsheet.
  • Core 19.0 registers all odoo_* chart subtypes itself, so the module's own chartSubtypeRegistry registrations were removed (core provides a superset: 20 subtypes vs the module's 7).
  • Core registers 12 odoo_* chart types but the module only provided side panels for odoo_line, odoo_bar and odoo_pie. Editing any other type threw Cannot find odoo_X in this registry!. Panels added for odoo_combo, odoo_scatter, odoo_pyramid, odoo_waterfall, odoo_radar, odoo_sunburst, odoo_treemap, odoo_geo and odoo_funnel.

Global filters

  • 19.0 changed filter values from flat shapes to typed objects carrying an operator (relation: {operator, ids}, text: {operator, strings}). Saving a relation filter previously threw No behavior found for filter type "relation" and operator "undefined".
  • Core's FilterValue now requires setGlobalFilterValue and globalFilterValue props and no longer dispatches itself; selecting a value threw this.props.setGlobalFilterValue is not a function.
  • 19.0 removed rangeType from date filters. Month/quarter/year/relative are now value-level choices, so the "Time range" selector and its branched default-value UI were replaced with core's DefaultDateValue component.

Lists and pivots

  • spreadsheet_oca.ListView.Buttons was declared twice for unrelated purposes. The tree-view one is renamed and no longer inherits the now-empty web.ListView.Buttons.
  • The "Add to spreadsheet" button anchors after the New button itself rather than after its container, keeping it inside the create-button group as 18.0 style did.
  • pivotMode / table structure pairing was inverted.
  • SELECT_ODOO_LIST no longer exists in 19.0 and has been dropped.
  • The list definition no longer persists the fields dict; data source re-fetches fields on load, so storing them froze a stale schema.

Security

  • res.groups.category_id is replaced in 19.0 by privilege_id pointing at a res.groups.privilege record, which carries the category. Simply dropping category_id loses the module's grouping in the user form, so a res.groups.privilege record is created instead.
  • res.groups.users renamed to user_ids.
  • ir.rule domains use user.all_group_ids rather than direct group membership, so users with an inherited (Manager) rather than direct (User) assignment are matched correctly.

Testing

Installed and tested on local Odoo 19.0 instance.

Manually tested: creating and opening spreadsheets, inserting pivots, lists and graphs from their respective views, editing charts of each type, global filters (date / relation / text), the Data menu, the Import wizard and the list-view upload button.

@mpiko — thanks for the original migration work; please review, since much of this builds on your findings.

@pedrobaeza

Copy link
Copy Markdown
Member

/ocabot migration spreadsheet_oca

@OCA-git-bot OCA-git-bot added this to the 19.0 milestone Jul 24, 2026
@OCA-git-bot OCA-git-bot mentioned this pull request Jul 24, 2026
3 tasks
@pedrobaeza

Copy link
Copy Markdown
Member

Please squash commit history merging the administrative commits with the one which generates them.

@chrisandrewmann

Copy link
Copy Markdown
Contributor Author

Please squash commit history merging the administrative commits with the one which generates them.

Sorry @pedrobaeza , which admin commits do you mean? Can you give example?

@pedrobaeza

Copy link
Copy Markdown
Member

etobella and others added 21 commits July 24, 2026 21:30
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
CarlosRoca13 and others added 27 commits July 24, 2026 21:37
…ertions

1- Removed the option to add in a new sheet; this will now be the default behavior of the option to add to an existing spreadsheet. Due to the nature of tables, they are always dynamic and structured in such a way that cells don’t contain static content, making it impossible to determine where previously inserted tables end within the spreadsheet. Therefore, we’ve chosen to follow Odoo’s approach, which always inserts data into new sheets.

2- Removed the use of dynamic column fields, as they are no longer used. Only dynamic rows are used now, for cases when a tree view is inserted.
The hotkey s is used by save, so this hotkey is overlapping with this one on tree views.

To solve this, it is changed referring to the icon used in the button (table).
Currently translated at 100.0% (119 of 119 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/it/
* Add Kanban views
* Also add active option

[IMP] spreadsheet_oca:
* Simplify partner usage
* Add tags
* Improve kanban view

[IMP] spreadsheet_oca: Improve form view

[IMP] spreadhseet_oca: add tag menu

[IMP] spreadhseet_oca: add default image

IMP: Add tag on view

[REF] spreadsheet_oca: no more partner

[REF] spreadsheet_oca: no more partner

[REF] spreadsheet_oca: no more partner

[REF]rename file
[ACL]Ad specific rule for manager
Currently translated at 100.0% (164 of 164 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/it/
…f each one

Before these changes, all existing chart types were displayed in the selector.

With these changes, the table type is taken into account, whether it is inserted from Odoo or from the spreadsheet itself, to determine which chart types are usable and which are not.
Currently translated at 100.0% (160 of 160 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/it/
This commit fixes the problem reported in this issue: OCA#96

Before these changes, the domain was taking the processed domain value, so it was using the value for the logged-in user. For example, if the uid variable was used, it was replaced with the user's ID and thus passed that way to the spreadsheet domains.

After these changes, the domain sent to the spreadsheet is the unprocessed domain, so the variables are preserved and remain fully usable.
Steps to reproduce the error:
1. Set debug=assets
2. Add a chart to spreadsheet
3. In "Link to Odoo menu" section select a record

An error will be thrown
Currently translated at 100.0% (161 of 161 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/it/
When a pivot has a sort defined and the data of the pivot is opened an error is thrown because the data is not processed correctly.

By doing this changes, we adapt the code to the new way of process the pivot data and the error does not being thrown anymore.
With this changes we are adding:
1. Include children records when it is possible
2. Add default values for the filter
3. If the model is for users allow set the current user by default
4. Allow to restrict values with a domain
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/it/
Currently translated at 59.0% (98 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/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/
@chrisandrewmann
chrisandrewmann force-pushed the 19.0-mig-spreadsheet_oca branch from 1cf2b3c to fe147f4 Compare July 24, 2026 20:38
@chrisandrewmann

Copy link
Copy Markdown
Contributor Author

@pedrobaeza please check commit history now, all done.
I used Claude to help as wasn't confident but ensured it followed the OCA policy, so looks good to me.

@arielbarreiros96 arielbarreiros96 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @chrisandrewmann, thanks for the contribution, I've been reading the code and doing some tests and it looks good to me. I only saw the thing with the new way to use domains (see domain Objects with some examples here), but for this module in particular the domains are so simple that I think we're good to go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.