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

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

<?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

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.

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

#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>

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

1 Like