Daily updates from Odoo
Monday, January 6, 2025
2 changes
1 change
Code cleanup and technical improvements
The Point of Sale system’s internal data handling has been reorganized to make the code easier to maintain and extend. This should not change day-to-day behavior for users, but it helps future updates across related Point of Sale features be delivered more reliably.
Original PR description
In this PR, we refactor the related_models module. There is now `Models` class that contains all the models. Also, a `CRUD` class is introduced to represent each model. We can get the model records from the `CRUD` methods. This refactoring is introduced so that the `Models` and the `CRUD` methods don't need to accept the instances as first param. `this` becomes usable in the `Models` and `CRUD` methods. Related: https://github.com/odoo/odoo/pull/189500
1 change
Code cleanup and technical improvements
This change centralizes how country-specific POS setups ensure essential customer records are available when a session opens. It helps avoid POS disruptions caused by partner loading limits while keeping the behavior easier to maintain across affected localizations.
Original PR description
For some localizations, some partners are required at all times for the POS to work properly. Since we restrict the number of loaded partners, we need to explicitly add those required partners to the set of partners loaded at the opening of the pos session. Previous fixes implemented this logic in pos_onfig. However it seems like it would make more sense to handle this from res.partner directly. This PR proposes such a change, where the required partners are being loaded from a newly dedicated function.