odoo views:create views in odoo, Tree view, form view, search view

Hello Odooers, Odoogig and Odoo Lovers,

In this Odoo  Technical Tutorial, I would like to explain about how to create views in odoo like in detail with code  example

  • Odoo support many types of views  but there are three type of main view which used by every odoo application and also to  show user interface . Here all those odoo views listed below
    1. Odoo Tree view or Odoo List view
    2. Odoo Form view
    3. Odoo Search Views
  • let’s understand all above odoo views in depth how we can create , syntax , and how they look on interface of odoo.
  • In general, Two Tags used to define view
    • record
    • field

 

1.record :
  • Record required two fields
  • a) id : Unique id for every odoo views. if duplicate or same id in other view then it will overlap other view
  • b) model : required scheme of ir.ui.view can be checked from the database
2.field :
  • Field tag required Three fields
  • a) name : name of the view
  • b) model :model name mapped to the view
  • c) arch : Root element of the view, must be define type is XML

 

Generic View Declaration

  • In odoo, all views are stored into database with ir.ui.view model. All views will be define with <record>  tag into .xml view . when installing module then relevant all xml views will be automatically loaded into the database. The view type is implied by the root element of the arch field:

 

1. Tree View

  • In Odoo tree view also called the list view, tree view show the record in table format
  • The root element of tree view is tree
  • Example

 

Odoo Tips

  • If you want to create record from the tree view then you used editable attribute in tree with the view of top or bottom, if you set top then new record create at top , if buttom the record create at bottom
  • Example

 

2. Form View

  • Odoo Form view used to create and edit of single record
  • The root element of form view is form, They Composed of high-level structure elements, (group, notebooks , page ) and iterative elements (buttons and fields)
  • Example

 

3. Search View

  • Odoo search view customise the search field associated with the list view.
    The root element of search view is search. field, filter and group by will be used in search view to analysis and quick search the data from list view
  • Example

  • For Example define domain in search view by default using filter element.

 

Odoo Tips 

  • Any odoo model , If search view not created  then by default odoo create view for searching name field of model.


GET IN TOUCH.!

We’d Love to Hear from You! We are happy to answer any questions, you have regarding My Training.

Mail : getodootraining@gmail.com

Skype : mayur_maheshwari1

What’s app : +919924542042

LEAVE A REPLY

Leave a Reply

Your email address will not be published. Required fields are marked *