Files
odoo_source/odoo
Raphael Collet f012e33769 [IMP] core: warn about compute methods mixing stored and non-stored fields
We explicitly discourage a compute method used for both stored and
non-stored fields, because it may be unexpectedly update the database.
Indeed, we don't expect the computation of a non-stored field to update
the database.  Allowing this kind of compute method makes reasoning
about readonly code much more difficult, and would prevent readonly
transactions with such fields.

For instance, consider a compute method for both fields F (non-stored)
and G (stored), and assume that none of those fields are in cache.
Whenever F is accessed, the compute method is invoked, and both fields
are assigned, which potentially generates an SQL update for field G.
This is problematic if we require the current transaction to be
readonly.

Part-of: odoo/odoo#98565
2023-09-19 16:37:03 +00:00
..
…
2022-10-19 15:12:44 +02:00
2023-09-13 12:19:10 +00:00