Odoo Help

0

what is the use of <field name="priority" eval="16"/>

By
kirubanidhi
on 6/9/16, 1:42 AM 1,033 views

can anyone tem le clear answer. why this field is used for form or list view

1
Zbik
On 6/9/16, 3:43 AM

From documentation:

This field priority is available in the view definition, and is 16 by default. By default, OpenERP will display a model using the view with the highest priority (the smallest number). For example, imagine we have two views for a simple model. The model client with two fields : firstname and lastname. We will define two views, one which shows the firstname first, and the other one which shows the lastname first.

<!--

Here is the first view for the model 'client'.

We don't specify a priority field, which means

by default 16.

-->

<record model="ir.ui.view" id="client_form_view_1">

<field name="name">client.form.view1</field>

<field name="model">client</field>

<field name="type">form</fiel>

<field name="arch" type="xml">

<field name="firstname"/>

<field name="lastname"/>

</field>

</record>

<!--

A second view, which show fields in an other order.

We specify a priority of 15.

-->

<record model="ir.ui.view" id="client_form_view_2">

<field name="name">client.form.view2</field>

<field name="model">client</field>

<field name="priority" eval="15"/>

<field name="type">form</fiel>

<field name="arch" type="xml">

<field name="lastname"/>

<field name="firstname"/>

</field>

</record>

Now, each time OpenERP will have to show a form view for our object client, it will have the choice between two views. It will always use the second one, because it has a higher priority ! Unless you tell it to use the first one !

thank for reply. Are you explained well .

kirubanidhi
on 6/10/16, 1:17 AM

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 6/9/16, 1:42 AM
Seen: 1033 times
Last updated: 6/9/16, 4:47 AM