Book Image

Odoo Development Cookbook

By : Holger Brunn, Alexandre Fayolle, Daniel Reis
Book Image

Odoo Development Cookbook

By: Holger Brunn, Alexandre Fayolle, Daniel Reis

Overview of this book

Odoo is a full-featured open source ERP with a focus on extensibility. The flexibility and sustainability of open source is also a key selling point of Odoo. It is built on a powerful framework for rapid application development, both for back-end applications and front-end websites. The book starts by covering Odoo installation and administration, and provides a gentle introduction to application development. It then dives deep into several of the areas that an experienced developer will need to use. You’ll learn implement business logic, adapt the UI, and extend existing features.
Table of Contents (23 chapters)
Odoo Development Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Adding content and widgets to a form view


The previous recipe showed how to pick a specific view for an action. Now we'll demonstrate how to make the form we defined previously more useful.

How to do it...

  1. 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>
  2. To add a head bar, usually used for action buttons and stage pipeline, add inside the form:

          <header>
            <button type="object" 
                    name="open_commercial_entity"
                    string="Open commercial partner"       
                    class="oe_highlight" />
          </header>
  3. Add fields to the form, using group tags to visually organize them:

          <group string="Content" name="my_content">
            &lt...