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

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

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

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

1

zbik

--zbik--
5976
| 6 4 7
Lodz, Poland
--zbik--


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

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: 6/9/16, 1:42 AM
Seen: 415 times
Last updated: 6/9/16, 4:47 AM