return (done, 0, 0, 0)
def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'):
+ """
+ Read records with given ids with the given fields
+
+ :param cr: database cursor
+ :param user: current user id
+ :param ids: id or list of the ids of the records to read
+ :param fields: optional list of field names to return (default: all fields would be returned)
+ :type fields: list (example ['field_name_1', ...])
+ :param context: optional context dictionary - it may contains keys for specifying certain options
+ like ``context_lang``, ``context_tz`` to alter the results of the call.
+ A special ``bin_size`` boolean flag may also be passed in the context to request the
+ value of all fields.binary columns to be returned as the size of the binary instead of its
+ contents. This can also be selectively overriden by passing a field-specific flag
+ in the form ``bin_size_XXX: True/False`` where ``XXX`` is the name of the field.
+ Note: The ``bin_size_XXX`` form is new in OpenERP v6.0.
+ :return: list of dictionaries((dictionary per record asked)) with requested field values
+ :rtype: [{‘name_of_the_field’: value, ...}, ...]
+ :raise AccessError: * if user has no read rights on the requested object
+ * if user tries to bypass access rules for read on the requested object
+
+ """
raise NotImplementedError(_('The read method is not implemented on this object !'))
def get_invalid_fields(self, cr, uid):
:param fields_list: list of fields to get the default values for (example ['field1', 'field2',])
:type fields_list: list
- :param context: usual context dictionary - it may contains keys in the form ``default_XXX``,
- where XXX is a field name to set or override a default value.
+ :param context: optional context dictionary - it may contains keys for specifying certain options
+ like ``context_lang`` (language) or ``context_tz`` (timezone) to alter the results of the call.
+ It may contain keys in the form ``default_XXX`` (where XXX is a field name), to set
+ or override a default value for a field.
+ A special ``bin_size`` boolean flag may also be passed in the context to request the
+ value of all fields.binary columns to be returned as the size of the binary instead of its
+ contents. This can also be selectively overriden by passing a field-specific flag
+ in the form ``bin_size_XXX: True/False`` where ``XXX`` is the name of the field.
+ Note: The ``bin_size_XXX`` form is new in OpenERP v6.0.
:return: dictionary of the default values (set on the object model class, through user preferences, or in the context)
"""
# trigger view init hook
return super(orm, self).fields_get(cr, user, fields, context, write_access)
def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'):
- """
- Read records with given ids with the given fields
-
- :param cr: database cursor
- :param user: current user id
- :param ids: id or list of the ids of the records to read
- :param fields: optional list of field names to return (default: all fields would be returned)
- :type fields: list (example ['field_name_1', ...])
- :param context: (optional) context arguments, like lang, time zone
- :return: list of dictionaries((dictionary per record asked)) with requested field values
- :rtype: [{‘name_of_the_field’: value, ...}, ...]
- :raise AccessError: * if user has no read rights on the requested object
- * if user tries to bypass access rules for read on the requested object
-
- """
if not context:
context = {}
self.pool.get('ir.model.access').check(cr, user, self._name, 'read', context=context)