How to do it...

  1. Define the basic structure of the form view:
<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>
  1. To add a head bar, which is 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>
  1. Add fields to the form, using group tags to organize them visually:
<group string="Content" name="my_content"> 
    <field name="name" /> 
    <field name="category_id" widget="many2many_tags" /> 
</group> 

Now, the form should display a top bar with a button and two vertically-aligned fields.

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

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