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?
Well, basically view mode shows the sequence and number of the views that shall be available in the view switcher at the top right corner of the tree/form view for a particular model after it is loaded from a menu item or any other way.
if you set view mode to tree,form then first tree view will be shown and then the form view will be opened after you click on one of the records, and the sequence will also be the same as first tree and then form view from left to right in the view switcher at the top right side of the view.
But the view type means how the record will be opened, means if it is set to form then when you click on one of the records in a tree view it will be opened in the form view, if you create a new record an empty form view will be opened,
But if the view type is set to tree then when you click the record it will not be opened in the form view and when you create a new record it will be created as a new row in the tree view