Tuesday, February 1, 2022
4 changes · master
Code cleanup and technical improvements
This update removes several old, unused internal mechanisms and simplifies how records are saved in Odoo. The change reduces maintenance overhead and supports more efficient future database operations, with little expected direct impact on day-to-day users.
Original PR description
Several changes to simplify CRUD, to avoid maintain unused feature and to be able to make a clean bulk insert (PR: https://github.com/odoo/odoo/pull/80961) ### [REM] base: remove _sequence attribute…
Several changes to simplify CRUD, to avoid maintain unused feature and to be able to make a clean bulk insert (PR: https://github.com/odoo/odoo/pull/80961) ### [REM] base: remove _sequence attribute of BaseModel The `_sequence` was only used for the insertion of data in the DB for the `id` value. But in Odoo, the `id` is always a `SERIAL`, then the PostgreSQL fill already the value by the right SQL sequence. Then, avoid doing the job of the DB by ourselves. Sadly, we need to manage the case when we create an empty record to always get a valid query. ### [REM] base: remove column_format of Field class The `column_format` of the `Field` class was unused and create useless noise in the ORM. Then remove it and simplify some flows. ### [REF] base: simplify the _write Issue: `_write` checked that the number of modified row in DB was equal to the number of ids in the RecordSet (raise `MissingError` if not). This behavior was only used by the ORM to retry (with exists() on the RecordSet before) if the Missing Error raised. Then it makes the job a second time (for no reason). Then: - Remove the check of number of row (and simplify the call of `_write`) - Remove the useless return value (always `True`) - Remove the `set(` before the `split_for_in_conditions`, it adds randomness for nothing because the `_write` should be call without duplicate id (even if it is not the case, we don't care). ### [REM] base: remove deprecated field attribute It was only used one time on a unused field. We don't want to keep useless fields anymore, the migration is done for that. odoo/upgrade#3194 task-2735546
Odoo now uses its built-in conversion for creating plain-text versions of HTML content, including email messages when no plain-text alternative is provided. This reduces reliance on an external library and keeps email formatting behavior more consistent across the platform.
The mail activity completion popover has been tidied as part of a broader style optimization effort. This keeps the interface easier to maintain while preserving the same user experience.
Original PR description
Part of the overall v16 SCSS optimization/restyle, #2704984 task: #2731819 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update simplifies the styling and markup used for attachment image previews in Odoo's mail features. It removes unused elements and adds shared opacity styling helpers, making the interface code easier to maintain with minimal visible impact for users.
Original PR description
Part of the overall v16 SCSS optimization/restyle, #2704984 task: #2731819 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr