Changing existing views – view inheritance
So far, we have ignored the existing views and declared completely new ones. While this is didactically sensible, you’ll rarely be in situations where you’ll want to define a new view for an existing model. Instead, you’ll want to slightly modify the existing views, be it to simply have them show a field that you added to the model in your add-on or to customize them according to your needs or your customers’ needs.
In this recipe, we’ll change the default partner form to show the record’s last modification date and make the mobile
field searchable by modifying the search view. Then, we’ll change the position of one column in the partners’ list view.
How to do it...
- Inject the field into the default form view:
<record id="hostel_room_view_form_inherit" model="ir.ui.view"> <field name="name">Hostel Room...