Community mailing list archives

Re: Need Help on 'Tree view' order

- 03/11/2015 08:03:03

Thank you for your answers! the 'default_order' one solve the problem!

Though Openerp V7 do not support default_order setting,  in ODOO v8,
It works wonderfully, I test it in two ways:

1. Directly use in tree view, like this:

<field name="arch" type="xml">
    <tree default_order="origin_plan desc">
        <field name="origin_plan"/>
        <field name="target_plan"/>
        <field name="result_origin_plan"/>
        <field name="result_target_plan"/>

2. Use in sub view, It's still working! like is:

<field name="cell_ids" nolabel="1">
    <tree editable="top" default_order="lesson desc">
        <field name="classroom"/>
        <field name="subject"/>
        <field name="teacher"/>
        <field name="week"/>
        <field name="lesson"/>

2015-03-10 6:18 GMT+08:00 Nicolas Schmitt <>:
Quoting the doc present there:

default_order: overrides the ordering of the view,
replacing the model’s default order.
The value is a comma-separated list of fields,
postfixed by desc to sort in reverse order:


I have never tried it though.

Please tell us how it goes!


On 09/03/15, Zou Haojun wrote:
> You need two make objects if you want two tree view. Each class can only has one _order
> On Mon, Mar 9, 2015 at 11:48 AM, Cy Snake < [1] > wrote:
> Hello guys,
> I defined a model like this:
> _order = 'create_date desc'
> then, This model have two list views, one need order by 'create_date
> desc' , but another one need order by 'p_date desc' , is ODOO. V8
> surpport this kind of behavior?
> _______________________________________________
> Mailing-List: [2]
> Post to: mailto: [3]
> Unsubscribe: [4]
> _______________________________________________
> Mailing-List:
> Post to:
> Unsubscribe:
> [1]
> [2]
> [3]
> [4]

Post to: