O'Reilly logo

Odoo Development Cookbook by Daniel Reis, Alexandre Fayolle, Holger Brunn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding buttons to forms

We added a button in the previous form, but there are quite different types of buttons to use. This recipe will add another button; also put the following code in to the previous recipe's header element.

How to do it...

Add a button referring to an action:

<button type="action" name="%(base.action_partner_category_form)d" string="Open partner categories" />

How it works...

The button's type attribute determines the semantics of the other fields, so we'll first look into the possible values:

  • action: This makes the button call an action as defined in the ir.actions.* namespace. The name attribute needs to contain the action's database id, which you can conveniently look up with a python format string containing the XML ID of the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required