Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
8806 มุมมอง

We want to have certain columns in a tree view sorted in an ascending way. In order to achieve it I tried to edit the tree view under Manufacturing Orders (Edit Tree View (Developers Mode)) and I added the following line

<tree default_order='x_Delivery_Date_To_FSLSales'>

It now reads:

<?xml version="1.0"?><tree fonts="bold:message_unread==True" colors="blue:state in ('draft','confirmed');red:date_planned&lt;current_date and state not in ('done','cancel');black:date_planned&gt;=current_date;gray:state in ('done','cancel') " string="Manufacturing Orders">

<tree default_order='x_Delivery_Date_To_FSLSales'>
</tree>

<field name="x_Delivery_Date_To_FSLSales"/>

<field name="sale_ref"> </field>

</tree>

It comes up with a 

ValidateError

Field(s) `arch` failed against a constraint: Invalid view definition

Can someone please help out on how to have a tree view sorted according to a specific column. I have seen various answers but could not figure out how to edit the view definition in order to achieve this.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello Raphael,

Can you try with this???

<?xml version="1.0"?>
<data>
<tree fonts="bold:message_unread==True" colors="blue:state in ('draft','confirmed');red:date_planned&lt;current_date and state not in ('done','cancel');black:date_planned&gt;=current_date;gray:state in ('done','cancel') " string="Manufacturing Orders" default_order='x_Delivery_Date_To_FSLSales'>
<field name="x_Delivery_Date_To_FSLSales" />
<field name="sale_ref" />
</tree>
</data>


อวตาร
ละทิ้ง
ผู้เขียน

Thank you for the suggestion: I am now getting the following error: "Uncaught TypeError: Type is not a function"

ผู้เขียน

Just removed the and and it now works fine. Thank you very much!

คำตอบที่ดีที่สุด

You have two </tree> tags!

<tree default_order='x_Delivery_Date_To_FSLSales'>
</tree>  <-- remove this
<field name="x_Delivery_Date_To_FSLSales"/>
<field name="sale_ref"> </field>
</tree>
อวตาร
ละทิ้ง
ผู้เขียน

Thank you for the answer. I have taken the line out and it now states: "Premature end of data in tag tree line 1, line 10, column 3"

Related Posts ตอบกลับ มุมมอง กิจกรรม
3
มี.ค. 15
17753
1
มี.ค. 15
4837
2
ม.ค. 25
782
0
ก.ย. 21
2236
0
ส.ค. 16
2931