[19.0][MIG] spreadsheet_oca: Migration to 19.0#122
Conversation
|
/ocabot migration spreadsheet_oca |
|
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? |
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
…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/
…s from the spreadsheet
…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.
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/
1cf2b3c to
fe147f4
Compare
|
@pedrobaeza please check commit history now, all done. |
arielbarreiros96
left a comment
There was a problem hiding this comment.
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

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:
active) —models/spreadsheet_spreadsheet_tag.pyandmodels/ir_model.pywere missing entirely; the kanban view, tags action and both configuration menus were gone from the view file; noactivefield.chart_panel.esm.jswas 41 lines vs 67 on 18.0 and still used the oldchartRegistry;chartSubtypeRegistryappeared zero times in the branch vs five times on 18.0.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_idandusersno longer usable as they were in 18.0groups_id→group_idsrenames inir.ruledomains and onir.ui.menu_sql_constraints→models.Constraint, and the constraint attribute name must start with an underscoreinheritable-method-lambdafix on the tag colour default_t()→self.env._()globalFiltersFieldMatchers→globalFieldMatchingRegistry, withgettersas the first argument to every matcher methodRELATIVE_DATE_RANGE_TYPES→RELATIVE_PERIODSloadSpreadsheetDependencies→loadBundle("spreadsheet.o_spreadsheet")file/settingsregistrations now provided by coregetTableStructure()split intogetCollapsedTableStructure()/getExpandedTableStructure()web.ListView.Buttonsis an empty template in 19.0, so the tree view's xpath-based inheritance had no anchorAdditional fixes made - Found whilst testing locally
Charts
ChartPanel/ChartTypePickerprops now carrychartIdonly, so everythis.props.figureIdresolved toundefinedand the chart menu selector silently did nothing. All 17 references updated acrossodoo_panels,chart_panelsandchart_panel.UPDATE_CHARTnow takesdefinition,chartId,figureIdandsheetId(resolved viagetFigureIdFromChartId/getFigureSheetId) instead ofid.CREATE_CHARTnow takesfigureId,chartIdandcol/row/offsetinstead ofidandposition. The old payload was rejected, so inserting a graph produced an empty spreadsheet.odoo_*chart subtypes itself, so the module's ownchartSubtypeRegistryregistrations were removed (core provides a superset: 20 subtypes vs the module's 7).odoo_*chart types but the module only provided side panels forodoo_line,odoo_barandodoo_pie. Editing any other type threwCannot find odoo_X in this registry!. Panels added forodoo_combo,odoo_scatter,odoo_pyramid,odoo_waterfall,odoo_radar,odoo_sunburst,odoo_treemap,odoo_geoandodoo_funnel.Global filters
relation:{operator, ids},text:{operator, strings}). Saving a relation filter previously threwNo behavior found for filter type "relation" and operator "undefined".FilterValuenow requiressetGlobalFilterValueandglobalFilterValueprops and no longer dispatches itself; selecting a value threwthis.props.setGlobalFilterValue is not a function.rangeTypefrom 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'sDefaultDateValuecomponent.Lists and pivots
spreadsheet_oca.ListView.Buttonswas declared twice for unrelated purposes. The tree-view one is renamed and no longer inherits the now-emptyweb.ListView.Buttons.pivotMode/ table structure pairing was inverted.SELECT_ODOO_LISTno longer exists in 19.0 and has been dropped.fieldsdict; data source re-fetches fields on load, so storing them froze a stale schema.Security
res.groups.category_idis replaced in 19.0 byprivilege_idpointing at ares.groups.privilegerecord, which carries the category. Simply droppingcategory_idloses the module's grouping in the user form, so ares.groups.privilegerecord is created instead.res.groups.usersrenamed touser_ids.ir.ruledomains useuser.all_group_idsrather 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.