Reader small image

You're reading from  Odoo 15 Development Essentials - Fifth Edition

Product typeBook
Published inFeb 2022
Reading LevelBeginner
PublisherPackt
ISBN-139781800200067
Edition5th Edition
Languages
Tools
Right arrow
Author (1)
Daniel Reis
Daniel Reis
author image
Daniel Reis

Daniel Reis has a degree in applied mathematics and an MBA. He has had a long career in the IT industry, mostly as a consultant implementing business applications in a variety of sectors. He has been working with Odoo (OpenERP at the time) since 2010 and is an active contributor to the Odoo Community Association (OCA), where he also serves as a board member. He is the managing director of Open Source Integrators, a leading open source and Odoo consultancy firm.
Read more about Daniel Reis

Right arrow

Adding options to the Action context menu

Window actions can also be used from the Action menu button, available at the top of form views, and also in list views when records are selected:

Figure 10.1 – The Action context menu

This menu is contextual because the action will apply to the record or records currently selected.

To have an action available in the Action menu, two more fields have to be set on the window action:

  • binding_model_id is a reference to the model to use the action for; for example, <field name="binding_model_id" ref="model_library_checkout" />.
  • binding_view_types can be used to limit the option's visibility to specific view types, such as form or list; for example, <field name="binding_view_types">form,list</field>.

An example of this has already been implemented in the library_checkout module, in the wizard/checkout_mass_message_wizard_view.xml file. This...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Odoo 15 Development Essentials - Fifth Edition
Published in: Feb 2022Publisher: PacktISBN-13: 9781800200067

Author (1)

author image
Daniel Reis

Daniel Reis has a degree in applied mathematics and an MBA. He has had a long career in the IT industry, mostly as a consultant implementing business applications in a variety of sectors. He has been working with Odoo (OpenERP at the time) since 2010 and is an active contributor to the Odoo Community Association (OCA), where he also serves as a board member. He is the managing director of Open Source Integrators, a leading open source and Odoo consultancy firm.
Read more about Daniel Reis