[19.0][MIG] database_size: Migration to 19.0#3632
Conversation
StefanRijnhart
left a comment
There was a problem hiding this comment.
Thank you. Can I ask why the commits don't reflect the history of the module in 18.0? https://github.com/OCA/server-tools/commits/18.0/database_size
|
/ocabot migration database_size |
|
@FREDDYGAMBOABEDOR I don't think @dnplkndll needs you to burn tokens to explain the OCA processes. The original PR comment above links to the source of your walkthrough (and referring to that link is all that your comment should have done in the first place) |
Currently translated at 100.0% (68 of 68 strings) Translation: server-tools-18.0/server-tools-18.0-database_size Translate-URL: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-database_size/it/
Currently translated at 100.0% (68 of 68 strings) Translation: server-tools-18.0/server-tools-18.0-database_size Translate-URL: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-database_size/it/
Fixes
```
File "/home/odoo/.local/lib/python3.12/site-packages/sentry_sdk/client.py", line 595, in _prepare_event
new_event = before_send(event, hint or {})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/user/oca-server-tools/sentry/hooks.py", line 66, in before_send
if event.setdefault("tags", {})["include_context"]:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'include_context'
2025-07-08 14:45:45,907 14296 INFO quatra-18-0-development-21441249 sentry_sdk.errors: before send dropped event
```
Error is only logged when running Sentry in debug mode, otherwise events are dropped silently.
Though TransactionCase rolls back database changes, it does not call `unlink` on `auditlog.rule` records, meaning that `unsubscribe` is never called to unpatch model methods. This causes subsequent tests in other modules to unexpectedly execute patched methods. This commit adds the `AuditLogRuleCommon` test class in an attempt to identify and prevent patched methods from contaminating the test environment.
Currently translated at 13.2% (9 of 68 strings) Translation: server-tools-18.0/server-tools-18.0-database_size Translate-URL: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-database_size/fr/
c6d731d to
e562fc7
Compare
e562fc7 to
fdbc49a
Compare
sorry my bot squash script was not right back then. looks good now the diff just seems to be 19.0 rebase activity. |
StefanRijnhart
left a comment
There was a problem hiding this comment.
Code looks good. Data gathering seems to work well. I did find a reporting issue:
| return self, new_domain | ||
|
|
||
| @api.model | ||
| def _where_calc(self, domain, active_test=True): |
There was a problem hiding this comment.
This method no longer exists. When opening the comparison menu and selecting a measurement date and/or a historic measurement date (for which there is data available), _table_query will still provide the default contents because these dates have not been inserted in the context. The domain will still filter out the selected dates, so if these are not the defaults the result is an empty list.
This also implies a lack of test coverage (mea culpa).
Data setup:
Report selection:
Snippet from the query returned by _table_query using the selection above:
select '2026-07-01'::date as measurement_date,
'2026-06-29'::date as historical_measurement_date,
...
from ir_model_size cur
left join ir_model_size hst
on cur.model = hst.model
and hst.measurement_date = '2026-06-29'::date
where cur.measurement_date = '2026-07-01'::date
Port of
database_sizefrom 18.0 to 19.0 (migration guide).Non-mechanical adaptations worth flagging
read_groupoverride →_read_group: 19.0 deprecated the publicread_group(would fail checklog) and the web client no longer routes group views through it, so the old override was both noisy and dead. Re-implemented on the non-deprecated_read_groupwith the 19.0 signature (groupby/aggregates/having/order); it still just defaults the group order for the size-report views._sql_constraints→models.Constraint(kept theuniq_model_measurement_datename)._compute_model_name: justified# pylint: disable=no-search-allon their.modelload (small registry table; new 19.0 pylint-odoo check). Theinformation_schemareferences are raw table-size SQL, unrelated to translatable-field jsonb assumptions.