Search
Close this search box.

Odoo – Inheritance view custom footer

Share This Post

The first task is to find out why the customer needs different logo’s or styles in the documents. In this case, it is because the company has multiple brands. Per customer, the brand is set for which the customer orders. Per brand, a custom footer needs to be created, and the default is overwritten. Read here how Jerbaco accomplished this.

If we want to change the default layout, mainly the header or footer, you can create an inheritance view in Odoo. This can be done in two ways:

  1. Creating a module so you can create an inheritance view in it.
    This code must be reinstalled as an add-on on the server (Odoo.sh, on-premise)
  2. By creating an inheritance view through the Web UI.

In this blog, we chose the second step, creating a view through the Web UI.
This is the easiest way to modify specific layouts quickly; also, this is a way that Odoo supports. So when upgrading to a new version, you are sure their support covers it and will help when something stops working.

Enable Debug mode in Odoo to activate the appropriate screens and settings.

Go to Settings -> Technical -> Views here you choose the default view you selected when you set the default layout.

In our case, we search on external_layout_boxed.

Furthermore, choose Inheritend view and create a new view.

Daarna vul je volgende code in om de footer te overiden.

<data>
  <xpath expr="//div[hasclass('text-center')]" position="replace">
       [Place here your new footer code!]
  </xpath>
</data>

The way to overide the header is the same but with hasclass(‘header’) as expr attribute value.

There are several ways to obtain the correct layout in Odoo. Each way has advantages and disadvantages but this is the most secure and supported way to overwrite certain sections of the default layout.

Happy Odoo!

More To Explore

Azure Kubernetes security common misconceptions

Azure Kubernetes Service (AKS) has emerged as a leading platform for container orchestration, offering scalability (with Keda), flexibility, and an easy management panel. However, like