Skip to Content
Menu
This question has been flagged
2 Replies
19410 Views

What exacty does each of these attribute values mean when used while defining act_window, for eg;

 <record id="open_estimate_quantity_extra_request" model="ir.actions.act_window">
   <field name="name">Extra Requests</field>
   <field name="res_model">estimate.quantity.extra.request</field>
   <field name="view_type">form</field>
   <field name="view_mode">tree,form</field>
 </record>

In the above code what does it mean to have a value of form for view_type and a value of tree,form for view_mode.  From what i understand, view_mode tells odoo to display both tree and form views for the  estimate.quantity.extra.request model.  But what purpose does view_type have?

Avatar
Discard
Best Answer

In default view type will be form. so if you give the modes tree,form, kanban then the view will show these three modes of view defined in odoo of the corresponding model. If the view_type = Tree. it returns a list view with no other modes. like the view in product categories and if we define the parent-child relations, it shows the child as dropdown.

Avatar
Discard
Best Answer

Hi Vivek,

view_mode: it is a character field for Comma-separated list of allowed view modes, such as 'form', 'tree', 'calendar', etc. (Default: tree,form).

view_type': It is a selection field (With values "form" & "tree")for select the type of view to be loaded.

Where Tree type to use for the tree view, set to 'tree' for a hierarchical tree view(Parent-Child Relation), 

        And 'form' for a regular list view.


Hope it may help you.

Avatar
Discard