ir.actions.act_window.view

The second record we defined works in unison with act_window, which we defined earlier. We already know that by setting the view_id field there, we can select which view is used for the first view mode. However, given that we set the view_mode field to the default tree, form, view_id would have to pick a tree view, but we want to set the form view, which comes second here.

If you find yourself in a situation like this, use the ir.actions.act_window.view  model, which gives you fine-grained control over which views to load for which view type. The first two fields defined here are examples of the generic way to refer to other objects; you keep the element's body empty but add an attribute called ref, which contains the XML ID of the object you want to reference. So, what happens here is that we refer to our action from the previous recipe in the act_window_id field, and refer to the view we just created in the view_id field. Then, though not strictly necessary, we add a sequence number to position this view assignment relatively to the other view assignments for the same action. This is only relevant if you assign views for different view modes by creating multiple ir.actions.act_window.view records.

Once you define the ir.actions.act_window.view records, they take precedence over what you filled in the action's view_mode field. So, with only the preceding records, you won't see a list at all, but only a form. So, you should add another ir.actions.act_window.view record pointing to a list view for the res.partner model.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.240.222