# Puzzled with XML tree view... Doesn't sort correctly, skipped field

**URL:** https://discuss.tryton.org/t/puzzled-with-xml-tree-view-doesnt-sort-correctly-skipped-field/3581
**Category:** Developer
**Created:** [December 20, 2020, 3:55am UTC](https://discuss.tryton.org/t/puzzled-with-xml-tree-view-doesnt-sort-correctly-skipped-field/3581 "2020-12-20T03:55:35Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![banknote](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/banknote/32/980_2.png) [@banknote](https://discuss.tryton.org/u/banknote)
#### Post date: [December 20, 2020, 3:55am UTC](https://discuss.tryton.org/t/puzzled-with-xml-tree-view-doesnt-sort-correctly-skipped-field/3581/1 "2020-12-20T03:55:36Z")

</div>

I used the following XML tree description, **need descending order** :

```auto
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tree tree_state="1" default_order="assess_datetime desc">
    <field name="assess_datetime" select="1" widget="date"/>
    <field name="assess_datetime" width="50" select="2" widget="time"/>
    <field name="license_plate"/>
    <field name="check_in_out"/>

```

With that, I am having the following list in a web-client:

 ![image](https://discuss-cdn.tryton.org/uploads/default/original/2X/e/ea3f1aee5b632dd7cd09c77436e19c8616cdf15d.png)

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [December 20, 2020, 3:13pm UTC](https://discuss.tryton.org/t/puzzled-with-xml-tree-view-doesnt-sort-correctly-skipped-field/3581/2 "2020-12-20T15:13:21Z")

</div>

There’s no attribute on XML view to define the order. It is defined on the `ir.action.act_window` or on the xxx2many field.

---

<div class="post-metadata">

### Author: ![banknote](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/banknote/32/980_2.png) [@banknote](https://discuss.tryton.org/u/banknote)
#### Post date: [December 20, 2020, 4:35pm UTC](https://discuss.tryton.org/t/puzzled-with-xml-tree-view-doesnt-sort-correctly-skipped-field/3581/3 "2020-12-20T16:35:16Z")

</div>

> [@ced](#):
>
> `ir.action.act_window`

How it could be done? The same requirement: I need a stack view — the last order is on the top.

```auto
#tryton_orders.xml

        <!-- ######################################### -->
        <!-- # Store orders tree(list) description # -->
        <!-- ######################################### -->
        <record model="ir.ui.view" id="orders_view_list">
            <field name="model">store.orders</field>
            <field name="type">tree</field>
            <field name="name">store_orders_list</field>
        </record>
        <!-- Open windows -->    
        <!-- # Open window with Orders -->
        <record model="ir.action.act_window" id="act_orders">
                <field name="name">Store Orders</field>
                <field name="res_model">store.orders</field>
        </record>

```

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [December 20, 2020, 6:13pm UTC](https://discuss.tryton.org/t/puzzled-with-xml-tree-view-doesnt-sort-correctly-skipped-field/3581/4 "2020-12-20T18:13:28Z")

</div>

There is an order field on `ir.action.act_window` that takes the same order as `ModelStorage.search`.
