orm: function_field_browse feature. optimize out calls to read() for fields
orm: function_field_browse feature. optimize out calls to read() for fields

It has been noted that within a model.read() we often need to compute the
function fields. These fields, sometimes, need access to the other data
of the record(s) and end up doing duplicate calls to self.read() because
fetched record data is not visible to them.

In order not to change the API and the footprint of function field getters,
we reuse the same arguments and pass browse_record_list() instead of plain
list of ids. Then, the browse() method within the getters will transparently
reuse the cache supplied through those record lists.

This feature must explicitly be enabled through a "_function_field_browse"
in the model declaration, for those models that are ready to handle the
new type of ids. Some models already do so, some need to be adapted, so
have it turned off by default.

xrg/openerp-server,xrg/openerp-server