Before this commit, the pivot's dataSources were managed by the core plugin
`PivotCorePlugin`. This didn't make sense since dataSources aren't core data:
- they are neither exported nor imported
- they can be different for each user (their ids were generated via uuidv4
at import)
- managing them required to handle local command in the core plugin
Moved the dataSources management to the UI plugin `PivotUIPlugin` and moved
the relevant getters inside this plugin. Changed the ids of the dataSources
to be the same as the pivot's id + a prefix, to avoid having to maintain a
mapping `pivotId` <=> `dataSourceId` .
This commit also removes the dataSourceId from the `INSERT_PIVOT`
command, which have no place here since this is a core command and the
dataSources are now a pure UI concept.
This is slighly more tricky than for lists, because the datasource need to
be loaded before the `INSERT_PIVOT` command to fetch the table structure.
The component dispatching the command need to make sure it creates a
dataSource with the id given by the getter `getPivotDataSourceId`,
or else the dataSource will be loaded twice.
Task: 3293491
Part-of: odoo/odoo#120136