Friday, April 12, 2019
2 changes · master
Resolved issues and error corrections
This fix prevents Odoo from temporarily showing or reusing an outdated value after a saved field is changed during the save process. It improves data accuracy in cases such as image resizing, custom save logic, or database-side adjustments, with little expected performance impact.
Original PR description
Before this commit, the field assignment would cache the value it received, even if that value was altered during `write`. This can happen if `write` is overridden (for example to resize images), or it could also happen if a database procedure is altering the value. To fix this issue, we do not cache the value that was assigned. This implies that additional queries may be necessary to retrieve the value, but those were already necessary most of the time, so it does not have a significant impact on performances.
This fixes how remaining component quantities are handled in manufacturing work orders. It prevents the system from incorrectly writing to an automatically calculated field, reducing the risk of inconsistent production information.
Original PR description
The field `component_remaining_qty` was assigned a value even though it is a compute field without inverse. This issue has been highlighted by https://github.com/odoo/odoo/pull/32460