Friday, February 17, 2023
2 changes · master
Code cleanup and technical improvements
This change removes unused internal code from Odoo's core field handling. It should not change how users work with Odoo, but it reduces unnecessary complexity in a heavily used area and may slightly improve maintainability and efficiency.
Original PR description
[REM] core: simplify `_update` of `_RelationalMulti` The `_update` of `_RelationalMulti` return a bool but the others `_update` methods doesn't return anything. It is actually not used. Also, the…
[REM] core: simplify `_update` of `_RelationalMulti` The `_update` of `_RelationalMulti` return a bool but the others `_update` methods doesn't return anything. It is actually not used. Also, the `_update` is always called with a recordset as `value`, then the first part of the method is useless. [REM] core: remove useless assert and set creation `write_batch` made an useless assertion (mathematically always true) and create a set for it, it is not free and this method is heavily used. Remove the assert, avoid creating the set and use the `all` method directly. [REM] base: remove useless `_remove_inverses` of `Many2oneReference` The `_remove_inverses` method of `Many2oneReference` class has been unused since its introduction. Remove it. [REM] core: remove small deadcode from `Selection` field `convert_to_cache` of the `Selection` field type, check that the column_type is 'int4'. But nowadays (since a0e05e2ab9055fa060b1f3b5adf7aa322e2617fd), a `Selection` field can only be a Varchar type. [REM] core: remove unused `null` method on `Field` class This method was unused since 8bc7d8565c3e4f954c479e3b51b863e4c03dc582.
This update removes older chart template structures and shifts related accounting reports and localization logic to the newer setup approach. It helps keep accounting configuration more consistent and easier to maintain, with little expected day-to-day impact for business users.