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
fixes#595
In the case where a property for the company exists but has no related record (e.g. in case of type m2o with no defined value), not setting a value to this field for a new record would create a new property (as browse_null is not an instance of browse_record)
In t-field, datetime fields (formatted and not formatted versions) are
converted to the context/user's timezone (through
fields.datetime.context_timestamp) when displayed, but were saved without
converting back so the next display would go forward (or back) of the user's
tzoffset.
Fix that by applying context_timestamp's conversion backwards, from the
context/user's timezone back to UTC, before saving the field's value.
_read_flat: remove duplicated fields in read call
get many2one: as False is instance of int, check the value of x first to avoid calling a name_get with a list of False
When we were reading twice a m2o field where at least one result is null, the first call to name_get would set the value to False instead of None and then accepted by the filter 'isinstance(x, (int,long))'
The get() method of m2o function fields is used for 2 different things:
- call the function defining the m2o
- get the name_get representation of the value
Until this pathc, only the first case was handled, resulting to a useless
recomputation of the field when reading it.
function fields for other records in the same model. Previously all function fields in the
current model were not computed for some reason not provided by the history.
We therefore compute effective store_ids on which the various trigerred
function fields will be computed again. Those ids are the ids given
in the store_get storage variable minus the deleted ones.
The active_test flag is meant for search(),
but when passed to search_read() it was also
propagated to the read() call.
This has little consequence normally because
read() ignores this flag, but it can have
side-effects when reading x2m fields or
function fields. They are likely to call
search() somewhere downstream, still with
the propagated active_test flag, while
it should not be applied anymore.
Ultimately dropping this flag could be
done by read() in all cases, but changing
search_read() is less likely to block
exotic cases where the flag was passed
on purpose. Moving it to read() could
be done as a later step.
return an action to open the document. This method is meant to be
overridden in addons that want to give specific view ids for example
bzr revid: dle@openerp.com-20140416143431-syqu1ko74xt04oo5