Wednesday, April 6, 2022
3 changes · master
Resolved issues and error corrections
This change adjusts how Odoo orders database columns so each saved record can use less storage space. It is an internal fix that can reduce database size for some tables without changing user-facing behavior.
Original PR description
This follows up https://github.com/odoo/odoo/pull/87896. Change the heuristics for ordering columns, as padding is not determined by column size, but by column alignment inside a row. Because in Odoo…
This follows up https://github.com/odoo/odoo/pull/87896.
Change the heuristics for ordering columns, as padding is not determined by column size, but by column alignment inside a row. Because in Odoo a row always starts with a column of size 4, the following columns should be the ones aligned on 4 bytes, then the ones aligned on 1 byte, then the ones aligned on 8 bytes.
The analysis in the commit message was not correct, as it did not take into account the fact that rows themselves are aligned on 8 bytes. So we have: before each row used 40 bytes (+24b header)
```
attname | typname | typlen
-------------+-----------+--------
id | int4 | 4
create_uid | int4 | 4
create_date | timestamp | 8
write_uid | int4 | 4 -> 4 bytes padding
write_date | timestamp | 8
active | bool | 1 -> 7 bytes padding
```
After each row uses 32 bytes (8 bytes saved per row):
```
attname | typname | typlen
-------------+-----------+--------
id | int4 | 4
create_uid | int4 | 4
write_uid | int4 | 4
active | bool | 1 -> 3 bytes padding
create_date | timestamp | 8
write_date | timestamp | 8
```
Of course, when more columns are present, the space savings depend on
the alignment of the other columns.This update fixes inaccurate website performance test expectations after an earlier technical change, ensuring test results match real-world behavior. It also restores a small optimization that avoids an unnecessary database lookup when serving public website pages.
Original PR description
An error regarding tests was not catch during httpocalypse [1] review. The test query counts were lowered in website by 2 everywhere, but it shouldn't have as there were no SQL perf improvement from…
An error regarding tests was not catch during httpocalypse [1] review. The test query counts were lowered in website by 2 everywhere, but it shouldn't have as there were no SQL perf improvement from this refactoring regarding website. The query count actually decreased because the test-only SQL Savepoints got divided by 2, probably thanks to a low level test improvement in the PR. But outside of tests, there were no SQL Query gained. This should have been reflected in the `EXTRA_REQUEST` variable instead. Before: Savepoint > Rollback > Savepoint > [Actual SQL Queries] > Rollback After: Savepoint > [Actual SQL Queries] > Rollback It is important to fix it because: 1. (Minor) There is a de-sync between the query count in the test and the actual query count (in the logs outside of tests), making it hard to figure. 2. (Major) Some controller got then wrongly lowered to 0 query counts instead of 2. An incoming PR in master would then make those tests expects negative query counts, which doesn't make any sense. [1]: https://github.com/odoo/odoo/pull/78857 Note that the exact commit can't be found by bisect as those don't work on their own, DB can't be started due to circular import.
This fix updates Indian tax report test data so invoices include required company and customer addresses and product HSN codes. It helps ensure invoices can be posted successfully under Indian EDI validation requirements, reducing false failures in compliance checks.
Original PR description
set address in company and partner and HSN code in product because it's required in Indian EDI