Adding content and widgets to a form view
The preceding recipe showed how to pick a specific view for an action. Now, we'll demonstrate how to make the form we defined earlier more useful.
How to do it...
- Define the form view basic structure:
<record id="form_all_customers" model="ir.ui.view"> <field name="name">All customers</field> <field name="model">res.partner</field> <field name="arch" type="xml"> <form> <!--form content goes here --> </form> </field> </record>
- To add a head bar usually used for action buttons and stage pipeline, add this inside the form:
<header> <button type="object" name="open_commercial_entity" string="Open commercial partner" class="btn-primary" /> </header>
- Add fields to the form, using
group
tags to visually organize them:
<group string="Content" name="my_content"> <field name="name" /> <field name...