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

Modify an existing handler


When you install the website module, the path /website/info displays some information about your Odoo instance. In this recipe, we override this in order to change this information page's layout, but also to change what is displayed.

Getting ready

Install the website module and inspect the path /website/info. Now craft a new module that depends on website and uses the following code.

How to do it…

We'll have to adapt the existing template and override the existing handler:

  1. Override the qweb template in a file called views/templates.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <odoo>
      <template id="show_website_info" inherit_id="website.show_website_info">
        <xpath expr="//dl[@t-foreach='apps']" position="replace">
          <table class="table">
            <tr t-foreach="apps" t-as="app">
              <th>
                <a t-att-href="app.website">
                <t t-esc="app.name" /></a>
              </th>
            ...