Commit Graph

109 Commits

Author SHA1 Message Date
Olivier Dony 57f79f9fa1 [REM] fields: remove fields.Any, temporary artifact for ill-typed fields
This was added in master-apiculture at f1f16a8 to
permit special function fields that return
structured JSON-like data.
This is unnecessary and caused typing problems, for
example for the type field of ir.model.fields, or
when you decide to store them.

It is simpler to explicitly declare these fields
as fields.Char and have them serialize their results
to JSON strings, or to declate them as fields.Binary
and return any opaque data they want.
2014-07-30 13:24:39 +02:00
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
sebalix 3f59135dce [FIX] read() method returns None values incompatible with XML-RPC 2014-07-20 16:06:50 +02:00
Raphael Collet 9ccdbcaca3 Merge pull request #989 from odoo-dev/8.0-sql-models-rco
[FIX] models, fields: add model dependencies for models backed up by sql views
2014-07-08 16:27:01 +02:00
Raphael Collet 603bde1b1b [IMP] fields: improve code in former commit 2014-07-08 15:52:02 +02:00
Raphael Collet b05cf32b8f [IMP] fields: add missing case for invalidating fields, when path is None 2014-07-08 15:47:44 +02:00
Raphael Collet 3fdc232352 [FIX] fields: add a type to field Id; this fixes #990 2014-07-08 13:29:45 +02:00
Raphael Collet a6b025d6d9 [FIX] models, fields: add model dependencies for models backed up by sql views 2014-07-08 10:16:16 +02:00
Raphael Collet cbe2dbb672 [MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.

- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
2014-07-06 17:05:41 +02:00