O'Reilly logo

Odoo Development Cookbook by Daniel Reis, Alexandre Fayolle, Holger Brunn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Changing existing views: View inheritance

Up until now, we ignored the existing views and declared completely new ones. While this is didactically sensible, you'll rarely be in situations where you want to define a new view for an existing model. What you'll rather want to do is to slightly modify the existing views, be it to simply have it show a field you added to the model in your addon, or to customize it to your needs or your customer's.

In this recipe, we'll change the default partner form to show the record's last modification date and also allow searching for that. Then we'll also show this column in the partners' list view.

How to do it...

  1. Inject the field in the default form view:
    <record id="view_partner_form" model="ir.ui.view"> <field ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required