How to Customize Invoice Layout in Odoo ?

By · Published · Updated · 3 min read
In short

Customizing the invoice layout in Odoo allows you to tailor the document to your specific needs. Whether you want to remove or adjust elements like the logo, you have several options. This guide explains two methods to customize your invoice layout: editing settings directly and creating a custom module. We will also…

Customizing the invoice layout in Odoo allows you to tailor the document to your specific needs. Whether you want to remove or adjust elements like the logo, you have several options. This guide explains two methods to customize your invoice layout: editing settings directly and creating a custom module. We will also provide an example of how to modify the logo space.

Edit the Invoice Template Directly from Odoo Settings

For a straightforward customization, you can modify the invoice template directly through Odoo’s settings. This method is suitable for making quick adjustments to the layout.

Steps to Edit from Settings

  1. Navigate to Settings in your Odoo interface.
  2. Go to Companies and select the company for which you want to change the invoice layout.
  3. In the Layout section, locate the HTML code for the invoice template.
  4. To modify the logo area, replace the existing logo code with a placeholder, for example:
   <div class="col-3 mb4" style="height: 60px;"></div>
  1. This change will remove the logo and add a 60px space in its place, allowing you to see how the layout adapts.

This method is effective for quick modifications and allows you to view changes immediately without creating a custom module.

Create a Custom Module to Inherit the Invoice Template

For more complex or reusable customizations, creating a custom module provides greater control and flexibility. This approach is useful for applying changes across multiple Odoo instances.

Steps to Create a Custom Module

  1. Create a new module directory (e.g., custom_invoice_layout) in Odoo's addons directory.
  2. Define the module’s __manifest__.py file to include dependencies such as web and account.
  3. In your XML file, inherit the web.external_layout_standard template and modify the logo area. For example:
   <odoo>
       <template id="external_layout_standard_inherited" inherit_id="web.external_layout_standard">
           <xpath expr="//div[@class='col-3 mb4']" position="replace">
               <div class="col-3 mb4" style="height: 60px;"></div>
           </xpath>
       </template>
   </odoo>
  1. Install the custom module in Odoo to apply the changes across your system.

This method is ideal for extensive customizations and can be reused across different instances or companies within Odoo.

FAQs

Why would I want to remove or adjust the logo in the invoice layout?

Adjusting or removing the logo can be beneficial when using preprint invoices, maintaining layout consistency, or aligning with specific branding guidelines. It ensures the invoice matches other documentation or physical materials.

Can I undo the changes made through the settings?

Yes, you can revert to the original layout by restoring the default logo code or using version control if available. For custom modules, uninstalling the module will revert to the default template.

Is it possible to target specific templates without affecting others?

Yes, when using the custom module approach, you can specifically target and modify templates like the invoice header without affecting other templates or layouts.

What are the advantages of using a custom module over direct settings edits?

A custom module provides more flexibility and control, allowing you to apply changes consistently across multiple instances or companies. It is suitable for complex customization that may need to be reused.

Conclusion

Customizing the invoice layout in Odoo can be done either through direct settings modifications or by creating a custom module. Both methods allow you to tailor the layout according to your needs, with direct edits offering simplicity and custom modules providing extensive customization options.

For further guidance, explore these resources:

Need someone to take operations off your plate?

Spend less time managing tasks. Focus more on growing your business.

You don't have to handle every operational detail yourself.

Whether you need ongoing virtual assistance, help managing your online store, or someone to coordinate projects and follow up on important tasks, I can help you keep things organized and moving forward.

Send me a message on WhatsApp or email with a short overview of your business and what you need. We'll discuss the scope in a brief call, agree on priorities and expectations, and I'll get started with a clear plan.

You can also hire me directly through Upwork.