bi_view_editor: wrong generation of ID column
BI View Editor
The id column generated by BI View Editor using CAST(row_number() OVER () as integer) AS id is broken and should be replaced. It generates non stable IDs so when you group or filter records, Odoo will display results not matching the filter or the group in its results.
This issue existed on bi_sql_editor and was fixed by using a subselect to get the rows and then inject the ids.
See method _prepare_request_for_execution on model bi.sql.view for a correct implementation https://github.com/OCA/reporting-engine/blob/e8df660d9b1a0b018fbd504f0a45bc59fe516c98/bi_sql_editor/models/bi_sql_view.py#L618-L638
Affected versions: all versions
for your information @astirpe
There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.
@gurneyalex @astirpe our workaround here is to sort the query by an id field to make the order deterministic - that leads to consistent results for our use case but might not be possible in every scenario.
There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.