Daily updates from Odoo
Friday, March 22, 2024
1 change · master
Code cleanup and technical improvements
Point of Sale data handling has been reworked so records are linked more consistently with the back office structure. This makes the system easier to reuse in Self-Order flows and should simplify future changes across localized PoS features.
Original PR description
Refactoring of model operation in all Point of Sale modules. The aim is to facilitate access to the various records and enable the use of PoS classes in the Self-Order. Records are now linked as in the backend. This link is managed via field information from the backend (many2many, many2one...). Remapping of field names has also been removed, so that frontend variable names correspond to backend variable names. Example: - Avant order.product.name - Now: order_id.product_id.name Example of model usage: ``` const pos_order = this.pos.models["pos.order"].getAll(); const lineProducts = pos_order.lines.map((l) => l.product); ``` It's very important not to access any more services / dependencies specific to the Point of sale in the model classes, as these will be used outside the PoS. Part 1: https://github.com/odoo/enterprise/pull/51000