Skip to content

[19.0][MIG] spreadsheet_oca: Migration to 19.0 (+ res.groups.privilege fix)#2

Open
dnplkndll wants to merge 236 commits into
19.0from
19.0-mig-spreadsheet_oca
Open

[19.0][MIG] spreadsheet_oca: Migration to 19.0 (+ res.groups.privilege fix)#2
dnplkndll wants to merge 236 commits into
19.0from
19.0-mig-spreadsheet_oca

Conversation

@dnplkndll

Copy link
Copy Markdown

Fork-internal PR to run CI on the 19.0 migration of spreadsheet_oca + a security fix.

Built on @mpiko's migration (OCA/spreadsheet#109) — his commits are preserved with attribution. Adds one fix on top:

[FIX] group categorization via res.groups.privilege — 19.0 replaced the old res.groups.category_id (ir.module.category) categorization with the new res.groups.privilege model. The migrated groups were left without a privilege_id, so the Spreadsheet role didn't appear in the user form (grantable only via the technical Groups view). This adds a res.groups.privilege linked to the existing category and sets privilege_id on both groups, restoring the 18.0 behaviour.

etobella and others added 30 commits March 29, 2026 06:16
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
weblate and others added 30 commits March 29, 2026 06:16
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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/
…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.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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/
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
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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/
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
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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/
19.0 replaced res.groups.category_id (ir.module.category) categorization
with the new res.groups.privilege model. The migrated groups were left
without a privilege_id, so the Spreadsheet role did not appear in the user
form and could only be granted via the technical Groups view. Add a
res.groups.privilege linked to the existing Spreadsheet category and set
privilege_id on group_user / group_manager, restoring the 18.0 behaviour.

Builds on the migration by @mpiko (OCA#109).
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.