[19.0][MIG] spreadsheet_oca: Migration to 19#109
Conversation
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
…wing errors." This reverts commit 7140455.
…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/
|
Testing on runboat, the options to add a pivot to spreadsheets don't appear. When opening data sources, a traceback is risen. It seems you have to check the migration deeper. |
|
Thanks for the feedback. I've addressed the issue with the pivot and data source panels. The root cause was getFormattedGroupBy() and sortedColumn.groupBy which no longer exist in Odoo 19 — the sortedColumn structure now only contains domain, order and measure. I've updated filter_panel_datasources.esm.js accordingly and tested locally — the pivot side panel and Data menu both open correctly without errors. |
|
Thanks for the feedback. I've addressed the issue with the pivot and data source panels. The root cause was getFormattedGroupBy() and sortedColumn.groupBy which no longer exist in Odoo 19 — the sortedColumn structure now only contains domain, order and measure. I've updated filter_panel_datasources.esm.js accordingly and tested locally — the pivot side panel and Data menu both open correctly without errors. |
[MIG] spreadsheet_oca, spreadsheet_dashboard_oca: Migration to 19.0
This PR migrates
spreadsheet_ocaandspreadsheet_dashboard_ocato Odoo 19.0 Community Edition. All fixes have been verified against a running Odoo 19.0 instance.Relates to #73
Python/XML changes
security/security.xmlcategory_idandusersfields fromres.groupsrecords — both removed in Odoo 19groups_id→group_idsinir.ruledomain expressionsviews/spreadsheet_spreadsheet.xmlgroups_id→group_idsonir.ui.menurecordmodels/spreadsheet_abstract.py_t()toself.env._()per Odoo 19 conventionmodels/spreadsheet_spreadsheet.py_t()toself.env._()per Odoo 19 conventionmodels/spreadsheet_spreadsheet_tag.pyinheritable-method-lambda:default=_get_default_color→default=lambda self: self._get_default_color()spreadsheet_dashboard_oca/models/spreadsheet_dashboard.py_t()toself.env._()per Odoo 19 conventionJavaScript changes
bundle/filter.esm.jsglobalFiltersFieldMatchersremoved fromglobal_filters_core_plugin— replaced byglobalFieldMatchingRegistryfrom@spreadsheet/global_filters/helperswith updated method signatures (all methods now takegettersas first argument)RELATIVE_DATE_RANGE_TYPESremoved from@spreadsheet/helpers/constants— replaced byRELATIVE_PERIODSfrom@spreadsheet/global_filters/helperstopbarMenuRegistry.add("file")andaddChild("settings")registrations already present in Odoo 19bundle/spreadsheet_renderer.esm.js@spreadsheet/assets_backend/helpersandloadSpreadsheetDependenciesremoved in Odoo 19 — replaced withloadBundle("spreadsheet.o_spreadsheet")from@web/core/assetsbundle/spreadsheet_action.esm.jsactionRegistry.add("action_spreadsheet_oca")requires{ force: true }as the action key is first registered by the lazy loader inweb.assets_backendbundle/odoo_panels.esm.jschartSubtypeRegistry.add(...)entries removed — these are now registered by the Odoo 19 communityspreadsheetmodule and caused a registry conflictbundle/filter_panel_datasources.esm.js{ force: true }topivotSidePanelRegistry.add("ODOO")— already registered by Odoo 19 community modulegetTableStructure()renamed togetCollapsedTableStructure()(static) andgetExpandedTableStructure()(dynamic)