CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I can manage ordering in a tree view with "_order = xxx" option in an object, but when I use a group by filter, this order is lost.
I have to order a column by hand to keep this order on the groupby view.
Does anyone know how to set an order by in a group by filter used by default?
Hi, try to override this method with orderby attribute you want :
read_group(cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False)
Get the list of records in list view grouped by the given groupby fields
cr -- database cursor
uid -- current user id
domain -- list specifying search criteria [['field_name', 'operator', 'value'], ...]
fields -- list of fields present in the list view specified on the object
groupby -- list of fields on which to groupby the records
offset -- optional number of records to skip
limit -- optional max number of records to return
context -- context arguments, like lang, time zone
order -- optional order by specification, for overriding the natural sort ordering of the groups, see also search() (supported only for many2one fields currently)
About This Community
Odoo Training Center
|Asked: 2/4/15, 11:16 AM|
|Seen: 1276 times|
|Last updated: 3/16/15, 8:10 AM|