summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2014-07-23 12:30:24 +0200
committerOlivier Dony <odo@openerp.com>2014-07-23 12:30:24 +0200
commit8974e928fa9f9b54ef3fbaf685aedbcccd2c755d (patch)
treed6836ed019b0b3d8bfc40a22466a3e0c267aa282 /addons
parent42f3575bb3fdc6c0b2a5c43685d7bd99d771f2fd (diff)
[FIX] fields: do not revalidate field values unless they are being modified
In the previous implementation of the new API fields, both fields.Selection and fields.Reference were performing early validation of their `value` as soon as it entered the cache, either by being read, written, or computed. This is a source of trouble and performance problems, and is unnecessary, as we should consider that the database always contains valid values. If that is not the case it means it was modified externally and is an exception that should be handled externally as well. Revalidating selection/reference values can be expensive when the domain of values is dynamic and requires extra database queries, with extra access rights control, etc. This patch adds a `validate` parameter to `convert_to_cache`, allowing to turn off the re-validation on demand. The ORM will turn off validation whenever the value being converted is supposed to be already validated, such as when reading it from the database. The parameter is currently ignored by all other fields, and defaults to True so validation is performed in all other caes.
Diffstat (limited to 'addons')
0 files changed, 0 insertions, 0 deletions