Daily updates from Odoo
Monday, May 13, 2024
2 changes
Code cleanup and technical improvements
This update cleans up how several business areas retrieve grouped data, without changing the visible features users rely on. It helps keep payroll, subscriptions, accounting settings, and localization processes easier to maintain and aligned with the main Odoo platform changes.
Original PR description
https://github.com/odoo/odoo/pull/163317
This update simplifies how embedded views are configured in Knowledge, making the underlying code easier to maintain and extend. There is no expected change for end users, but it reduces future development friction and avoids duplicated configuration data.
Original PR description
The function `_insertEmbeddedView` accepts 7 parameters to set up an embedded view. Some of these parameters are optional or incompatible with each other. For example: it makes no sense to pass the…
The function `_insertEmbeddedView` accepts 7 parameters to set up an embedded view. Some of these parameters are optional or incompatible with each other. For example: it makes no sense to pass the xml id of an action and an actual action object. To insert an embedded view, the developer has to pass many null, undefined or falsy values to the function, making the code difficult to read and maintain. To improve this, the function will accepts a single object containing all the props of the embedded views. This object will directly be encoded in the blueprint of the behavior. The caller will now be responsible for providing a valid configuration with the required values. The advantage of directly passing the props of the embedded view to the `_insertEmbeddedView` function is that we will not have to update the API of the function in the future whenever we define a new prop to the embedded view behavior. The `_insertEmbeddedView` function will also no longer copy the action helper of the action to the behavior props of the embedded view. Doing the copy was duplicating data and was not necessary as the action helper is, by default, loaded from the loaded action unless a custom one is defined in the behavior props. task-3847699