tree sort order

Asked by Gerhard du Toit

1. How do change the default sort order of a tree. (web client)
2. When filtering a tree and the result is many rows, when clicking on column title only sorts the current page. How do I get the entire filter result sorted by something other than the default sort order.

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
David Mitchell (www.novapointgroup.com)
Solved:
Last query:
Last reply:
Revision history for this message
Gerhard du Toit (gdutoit) said :
#1

How do I delete questions from launchpad.

This is because of Launchpad's terrible performance. You submit something and nothing happens. Then you try again and again.

I see the launchpad server is hosted in the UK. I access many other sites in the UK and none of them are so unresponsive and slow as launchpad.

Am I the only one experiencing this or is this the norm.

Revision history for this message
Ferdinand (office-chricar) said :
#2

On Montag 30 August 2010 07:57:18 Gerhard du Toit wrote:
> Question #123110 on OpenObject Server changed:
> https://answers.launchpad.net/openobject-server/+question/123110
>
> Gerhard du Toit posted a new comment:
> How do I delete questions from launchpad.
>
> This is because of Launchpad's terrible performance. You submit something
> and nothing happens. Then you try again and again.
>
> I see the launchpad server is hosted in the UK. I access many other sites
> in the UK and none of them are so unresponsive and slow as launchpad.
>
> Am I the only one experiencing this or is this the norm.
it is slow

Best Regards

ChriCar Beteiligungs- und Beratungs- GmbH
http://www.chricar.at/ChriCar/index.html
Dr. Ferdinand Gassauer
Official Tiny Partner

Revision history for this message
Best David Mitchell (www.novapointgroup.com) (david-novapointgroup.com) said :
#3

Gerhard,

The sort order is not controlled in a "view" but rather at the object level using the _order attribute. This can be found in the technical memento on page 2 in the "Predefined osv.osv attributes for business objects" section. If this is not defined for an object then it takes on the default which is order by 'id'.

Now that we have the "search layout more flexible in Version 6" what needs to be done is improvement on the filtering and returning results order view. Perhaps a new field to modify (order_by) selection filter and another field order (default, current view or all records) selection as well. So _order in an object sets the default order, if a user selects a different field in the "order_by" selection field on a view the results reorder, and a field to indicate whether to display results (default, within current view, within current filtered selection, or all records). Just an idea . . .

Here is an example from the base module res.partner - where the order is by name.

class res_partner_function(osv.osv):
    _name = 'res.partner.function'
    _description = 'Function of the contact'
    _columns = {
        'name': fields.char('Function Name', size=64, required=True),
        'code': fields.char('Code', size=8, required=True),
        'ref':fields.char('Notes', size=32,),
    }
    _order = 'name'
    _sql_constraints = [
        ('code_uniq', 'unique (code)', 'The Code of the Partner Function must be unique !')
    ]
res_partner_function()

You can also have more than one field value in the _order field for example: _order = 'parent_id,name'. You'll find this example in the base module in res.partner (def _check_recursion(self, cr, uid, ids):).

The only way to change the behavior of "when you click on a column heading to sort through the entire set of records" versus only through the visible view is to write code to do so for the GTK client and the Web client separately. (We've seen it done with the GTK client on 5.0 but not in the web-client to to date. As ChriCar indicates the feedback we've always been told is that it is slow as a result.

I hope this provides at least some guidance.

Revision history for this message
Gerhard du Toit (gdutoit) said :
#4

Thanks for this explanation. It helps to understand the technical aspect but does not really solve the problem.
I sincerely hope your suggestions are taken into V6.0.
Is there any way to "influence/vote" issues such as this higher up in the priority list?