Please sign in to comment.
[FIX] core: computed fields can be copied if editable
Purpose of this commit is to let computed stored editable fields being copied if their field class allows it. Indeed the value of those fields is computed based on some triggers but can also be updated manually by users. When copying a record, it makes sense to consider that this value is what the user expects and allow its copy, if the original field allows it. Either it was computed, and copied value will be correct without having to call computation again (well, provided all dependencies have been copied, too), or it was updated and the copied value will be the one the user entered. Without this fix, an edited field is not copied, and will be recomputed, which may look like an inconsistent value. Task ID 2209163 X-original-commit: 4b274d3 Co-authored-by: Raphael Collet <email@example.com>
- Loading branch information
Showing with 104 additions and 7 deletions.
- +4 −4 addons/sale_timesheet/tests/test_sale_service.py
- +38 −0 odoo/addons/test_new_api/models/test_new_api.py
- +1 −0 odoo/addons/test_new_api/security/ir.model.access.csv
- +22 −1 odoo/addons/test_new_api/tests/test_new_fields.py
- +35 −0 odoo/addons/test_new_api/tests/test_onchange.py
- +4 −2 odoo/fields.py