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

Having an action open a specific view


Window actions automatically determine the view to be used, but sometimes we want an action to open a specific view.

We will create a basic form view for the partner model and make the window action specifically open it.

How to do it...

  1. Define the partner minimal 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>
                <group>
                    <field name="name" />
                </group>
            </form>
        </field>
    </record>
  2. Tell the action from the previous recipe to use it:

    <record id="action_all_customers_form"
            model="ir.actions.act_window.view">
        <field name="act_window_id" ref="action_all_customers" />
        <field name="view_id" ref="form_all_customers" />
        <field name="view_mode">form...