[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
|
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. |
| return this.columns | ||
| .filter( | ||
| (col) => | ||
| col.type === "field" && |
|
This one mixes 2 modules. Please isolate only |
|
@mpiko tested on runboat and getting this error when trying to open the "Spreadsheets" menu. Resume of the error:
|
|
The list view crash reported here (o_list_buttons xpath target not found on web.ListView.Buttons) has been fixed in the latest commit (370c4dc). Root cause: web.ListView.Buttons is now an empty template in 19.0 core (list buttons are rendered via a slot call, t-call="{{ props.buttonTemplate }}", with no wrapping div.o_list_buttons), so the module's xpath-based inheritance had nothing to attach to. Fixed by having spreadsheet_oca.ListView.Buttons render its content directly rather than inheriting from the now-empty core template. While testing, two related issues found and are fixed in the same commit: A template name collision (spreadsheet_oca.ListView.Buttons was defined twice in the module, for two unrelated purposes). Verified on runboat (build for 370c4dc): Spreadsheets menu loads without error, Upload button renders and functions, "Add to spreadsheet" still works correctly on unrelated list views, and the Import Pivot wizard completes an actual import end to end with all group privilege levels. @arielbarreiros96 would appreciate a re-test on your end to confirm. |
|
Thanks @mpiko i've just tested and lists seem to be working much better. I tested the pivots however and there is still a lot to do there.
Steps below to reproduce adding pivot error:
|
|
Pushed a second fix (2693060): the pivot-to-spreadsheet crash from your last comment (ds.getTableStructure is not a function). That method was split into getCollapsedTableStructure/getExpandedTableStructure upstream in o-spreadsheet; this module's own PivotPanelDisplay already uses the split correctly elsewhere, only importDataPivot was missed during the migration. Fixed by matching that existing convention (getExpandedTableStructure for dynamic mode). Verified on mint-dev: pivot import from Invoices Analysis now completes and produces the correct table. |
Thanks, pivots seem to work well for me now. I'd ask if you could check your 19.0 branch incorporates the PRs that were merged for 18.0 since created. Update: Seems like you need rebase on latest 18.0 and reapply your changes on-top. |
|
@mpiko I have my own branch which is a rough prototype of spreadsheet_oca working in 19.0, which may be helpful. Although its much older than yours. Couple of issues that mine solved, which I observed are not right on your branch:
|
|
@mpiko I've run a check through Claude and it gave this as the reason for the regressions: Both commits are contaminated: 3f651a7 ("Migration to 19.0"): strips 160 lines from views/spreadsheet_spreadsheet.xml — that's PR84's kanban/tags/menus being deleted, disguised as migration work. |
…tionality regressed during 19.0 migration
|
Pushed two more commits (86b3cd8, feb96f1) addressing the regression you flagged and several related issues found while investigating it. 86b3cd8: restored functionality lost in earlier migration commits. Confirmed via git show on the flagged commits (3f651a7, 31c738d) that both contained unrelated feature strips alongside genuine migration fixes: the kanban view, tags model, badge image, chatter/activity mixins, and archive support were all removed without technical justification, not because anything in them was actually 19.0-incompatible. Restored all of it: spreadsheet.spreadsheet.tag model, ir.model extension, kanban view, tags menu/action, mail.thread/mail.activity.mixin inheritance (now with mail added to depends explicitly), and the active field with archive ribbon. Kept the one genuine fix from those commits (groups_id -> group_ids rename). feb96f1: pivot/list/graph insertion and chart type picker fixes:
All of the above verified directly on a live 19.0 instance, not just read from source. @arielbarreiros96, appreciate another look when you have time |
…ker, and remove dead pivot code
feb96f1 to
221ad05
Compare
|
Thanks @mpiko however as there are still sevearl further issues, I felt it simpler to start a new PR here #122 It also splits spreadsheet_oca from spreadsheet_dashboard_oca, which will be done seperately. |
|
Yes, each PR should be one module, not several, and if this one doesn't contain latest 18.0 improvements, I think it's better to switch to the other PR. |
[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)