_protected = ['read','write','create','default_get','perm_read','unlink','fields_get','fields_view_get','search','name_get','distinct_field_get','name_search','copy','import_data','search_count', 'exists']
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None):
+ """
+ Get the list of records in list view sorted by the given fields
+
+ :param cr: database cursor
+ :param uid: current user id
+ :param domain: a list specifying search criteria [['field_name', 'operator', 'value'], ...]
+ :param fields: a list of fields present in the list view specified on the object
+ :param groupby: a list of fields on which to sort the records
+ :type fields_list: a list (example ['field_name_1', ...])
+ :param offset: optional number of records to skip
+ :param limit: optional max number of records to return
+ :param context: context arguments, like lang, time zone
+ :return: a list of dictionaries(one dictionary for each record) containing:
+
+ * the values of fields sorted out by the fields in groupby arguement
+ * __domain: a list of tuples specifying the search criteria
+ * __context: a dictionary with argument like 'groupby'
+ :rtype: [{'field_name_1': 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
+
+ """
groupby_list = groupby
- groupby = groupby[0]
+ if isinstance(groupby, list):
+ groupby = groupby[0]
context = context or {}
self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context)
if not fields: