There's more...

Window actions also support a target attribute to specify how the view is to be presented. The possible choices are as follows:

  • current: This is the default and opens the view in the web client main content area.
  • new: This opens the view in a popup.
  • inline: Like current, but opens a form in edit mode and disables the Action menu.
  • fullscreen: The action will cover the whole browser window, so this will overlay the menus too. Sometimes, this is called tablet mode.
  • main: Like current, but also clears out the breadcrumbs.

The window action's view_type attribute is mostly obsolete by now. The alternative to the default form is tree, which causes grouped lists to render a hierarchical tree. Don't confuse this attribute with the view_mode attribute that's used and explained in the How it works section of this recipe, which actually decides which types of views are used.

There are also some additional attributes available for window actions that are not supported by the act_window shortcut tag. To use them, we must use the record element with the following fields:

  • res_id: If opening a form, you can have it open a specific record by setting its ID here. This can be useful for multi-step wizards, or in cases when you have to view or edit a specific record frequently.
  • search_view_id: This specifies a specific search view to use for tree and graph views.
  • auto_search: This is True by default. Set this to False if searching for your object is very time- and/or resource-consuming. This way, the user can review the search parameters and press Search when satisfied. With the default value, the search is triggered immediately when the action is opened.

Keep in mind that the menu in the top-left (or the apps icon in the enterprise version) and the menu in the bar at the top are both made up of menu items. The only difference is that the items in the menu in the top-left don't have any parent menus, while the ones on the top bar have the respective menu item from the top bar as a parent. In the left bar, the hierarchical structure is more obvious.

Also bear in mind that for design reasons, the first-level menus will open the dropdown menu if your second-level menu has child menus. In any case, Odoo will open the first menu item's action based on the sequence of child menu items.

..................Content has been hidden....................

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