odoo/openerp
Olivier Dony 8974e928fa [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.
2014-07-23 12:30:24 +02:00
..
addons [REF] OpenERP --> Odoo in various UI texts (2) 2014-07-18 14:59:38 +02:00
cli [MERGE] new v8 api by rco 2014-07-06 17:05:41 +02:00
conf [MERGE] openerp.pooler is deprecated. 2013-03-27 17:40:45 +01:00
modules [REM] asynchronous database creation method 2014-07-15 12:26:55 +02:00
osv [MERGE] Fwd-port saas-4 up to e31fd6a 2014-07-11 12:00:42 +02:00
report [REF] OpenERP --> Odoo in various UI texts 2014-07-18 13:45:41 +02:00
service Merge pull request #1169 from xmo-odoo/8.0-remove-async-db-create-xmo 2014-07-16 10:29:21 +02:00
tests [MERGE] new v8 api by rco 2014-07-06 17:05:41 +02:00
tools [REF] OpenERP --> Odoo in various UI texts 2014-07-18 13:45:41 +02:00
workflow [MERGE] new v8 api by rco 2014-07-06 17:05:41 +02:00
PKG-INFO [REM] netrpc: KILL EVERYBODY 2013-02-21 13:18:25 +01:00
__init__.py [MERGE] new v8 api by rco 2014-07-06 17:05:41 +02:00
api.py [FIX] unsafe listification of weakref in Python < 2.7.4 2014-07-07 13:51:53 +02:00
exceptions.py [MERGE] new v8 api by rco 2014-07-06 17:05:41 +02:00
fields.py [FIX] fields: do not revalidate field values unless they are being modified 2014-07-23 12:30:24 +02:00
http.py [FIX] data-dir management 2014-07-07 15:49:24 +02:00
import_xml.rng [MERGE] Replace inherit_option_id by a selection field (PR #229) 2014-05-27 17:57:33 +02:00
loglevels.py [REF] logging: removed pseudo log-level TEST. 2013-03-26 16:58:44 +01:00
models.py [FIX] fields: do not revalidate field values unless they are being modified 2014-07-23 12:30:24 +02:00
netsvc.py [IMP] module loading and tests profiling 2014-06-29 18:58:15 +02:00
pooler.py [IMP] registry: avoid every direct access registry.db, and rename attribute as registry._db 2014-04-09 15:35:15 +02:00
release.py [REF] OpenERP --> Odoo in various UI texts 2014-07-18 13:45:41 +02:00
sql_db.py [IMP] test display sql query counter 2014-07-01 21:57:55 +02:00