Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the use of ir.ui.view in odoo?

Tags:

odoo

odoo-8

Currently I am learning odoo. I would like to know what is ir.ui.view? This is my sample code

        <record model="ir.ui.view" id="course_search_view">
            <field name="name">course.search</field>
            <field name="model">openacademy.course</field>
            <field name="arch" type="xml">
                <search>
                    <field name="name"/>
                    <field name="description"/>
                </search>
            </field>
        </record>
like image 368
Akhil Mathew Avatar asked Jan 18 '16 10:01

Akhil Mathew


1 Answers

IR = Information Repository

RES = Resource

These are two kinds of data that are stored in Odoo.

A resource matches something in the 'real world' that you store in Odoo - to represent information about partners, or products or accounting transactions.

The Information Repository is used to store data needed by Odoo to know how to work as an application - to define menus, windows, views, wizards, database tables, etc.

The ir.ui.view is used for the views where you show the field or tree list

You have more information in the Odoo Documentation:

Views define the way the records of a model are displayed. Each type of view represents a mode of visualization (a list of records, a graph of their aggregation, …). Views can either be requested generically via their type (e.g. a list of partners) or specifically via their id. For generic requests, the view with the correct type and the lowest priority will be used (so the lowest-priority view of each type is the default view for that type).

<record model="ir.ui.view" id="view_id">
    <field name="name">view.name</field>
    <field name="model">object_name</field>
    <field name="priority" eval="16"/>
    <field name="arch" type="xml">
        <!-- view content: <form>, <tree>, <graph>, ... -->
        [...]
        <field name="field_name" />
        [...]
    </field>
</record>
like image 58
Jainik Patel Avatar answered Sep 30 '22 18:09

Jainik Patel