Thursday, February 16, 2023
5 changes · master
Code cleanup and technical improvements
This update reorganizes how field widgets are registered behind the scenes, separating business field details from the visual component setup. It should make future maintenance easier and more consistent across Odoo apps without changing day-to-day user workflows.
Original PR description
Before this commit, the field's description was stored on the component and this component was then registered. Now, an object describing the field is used on registration the same way as it is done for views since https://github.com/odoo/odoo/commit/b828cfc72c587d0b73fcc5459695705640437671. This split the component's description (props, template, ...) of the field's description (displayName, supportedTypes, ...) and makes it clearer. task: 3171520
Point of Sale tax calculations now use the same tax amount values as the main accounting system, reducing the chance of inconsistencies. An internal duplicate field was removed and replaced with existing tax distribution data, making offline POS tax handling simpler and more reliable.
Original PR description
To be able to compute the taxes offline, the POS JS code mimicked the `compute_all` function in `account_tax.py`. At some point, the POS added an extra field on `account.tax` (see:…
To be able to compute the taxes offline, the POS JS code mimicked the `compute_all` function in `account_tax.py`. At some point, the POS added an extra field on `account.tax` (see:
https://github.com/odoo/odoo/commit/8fb53c53c3128e8cea7ef20b9ab4946ac2f9b7d9): `real_amount` which is defined as:
real_amount = tax.amount * sum(tax.repartition_line.factor)
Then, when fetching the data from the server to the client, the `real_amount` was passed in place of the `amount`.
But then, the `amount` field in the JS is no longer the same as in the python code and it is very error prone. In addition, it's easy to get rid of this extra field by using the sum of the factors from the repartition lines.
Now, we pass the sum(tax.repartition_lines.factor_percent)/100, which is equivalent to sum(tax.repartition_line.factor) to the client, and use it in the `compute_all` as done in the python function, and leave `tax.amount` untouched.
Both `compute_all` functions now operate using the same `tax.amount` and we get rid of the `real_amount` field.
upgrade-https://github.com/odoo/upgrade/pull/4307The domain selector has been reorganized so its code is centralized in fewer components and files. This makes the feature easier for developers to understand and maintain, with no expected change to day-to-day user behavior.
Original PR description
This commit is a refactoring of the domain selector to simplify it. The component DomainSelector now uses less sub components. Consequently, the code is centralized in fewer files and more readable. task: 3149707
This update reorganizes how custom field definitions are registered across several Odoo apps. It does not change business workflows, but makes the underlying structure clearer and easier to maintain for future improvements.
Original PR description
Before this commit, the field's description was stored on the component and this component was then registered. Now, an object describing the field is used on registration the same way as it is done for views since https://github.com/odoo/odoo/commit/b828cfc72c587d0b73fcc5459695705640437671. This split the component's description (props, template, ...) of the field's description (displayName, supportedTypes, ...) and makes it clearer. task: 3171520
This update restructures internal data model handling to align the enterprise codebase with related platform changes. It should help keep business apps consistent and easier to maintain, with limited direct impact on day-to-day users.
Original PR description
This commit is the counterpart of odoo/odoo#112518