Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

[SOLVED]tree default_order causes a ValidateError: Invalid View Definition

By
Raphael
on 12/3/15, 8:27 AM 855 views

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.

0

Jusab Sida (jsi)

--Jusab Sida (jsi)--
Tiny ERP Pvt Ltd
http://www.odoo.com
874
| 2 1 5
Gandhinagar, India
--Jusab Sida (jsi)--


Jusab Sida (jsi)
On 12/8/15, 5:51 AM

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"

Raphael
on 12/8/15, 6:53 AM

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

Raphael
on 12/9/15, 9:29 AM
0
Pouya Maleki
On 12/8/15, 3:59 AM

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"

Raphael
on 12/8/15, 4:22 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 12/3/15, 8:27 AM
Seen: 855 times
Last updated: 3/1/16, 6:33 AM