Daily updates from Odoo
Friday, February 28, 2025
1 change · master
Code cleanup and technical improvements
The relationship selection fields used across several apps have been reworked to rely on shared components instead of complex inheritance. This should make future improvements easier and reduce maintenance risk, with limited direct impact on day-to-day users.
Original PR description
This commit refactors the many2one field widgets. The goal of this commit is to reduce the complexity of creating a new many2one widget and simplify the addition of new features on existing widget. Before this refactoring, some widgets were inheriting one another to support avatars (m2o_avatar, m2o_avatar_user, m2o_avatar_resource, m2o_avatar_employee). With time, the relation between these widgets became really complex. They have a form and a kanban version and to simplify the common features between version we used mixins. This created an diamond inheritance problem and it was complicated to manage while developing new features. Now, we have a new component "Many2One" that we can use to display a many2one and another for its kanban version. community: https://github.com/odoo/odoo/pull/196785 enterprise: https://github.com/odoo/enterprise/pull/78992 task-3679690