Odoo Help


Can't manage to use a custom layout in Odoo 8

Aurélien Rivet
on 2/29/16, 9:22 AM 1,217 views


I am trying to make a custom quotation layout. I would like this layout has no header but use the default footer of report.external_layout. Also, I want to style this footer.

So, in a file, I create a custom footer template which I call report.custom_external_layout and in which I add using xpath a style tag:

<template id="report.custom_quotation_footer" inherit_id="report.external_layout_footer"> <xpath expr="//div[@class='footer']" position="before">


            //My style




Then, I make a new layout which inherits from report.external_layout and remove the header part:

<template id="report.custom_quotation" inherit_id="report.external_layout">

    <xpath expr="//t[@t-call='report.external_layout_header']" position="replace">



Last, I want call my custom layout into the definition of my report,

<template id="sale.nice_quotation">

    <t t-call="report.custom_quotation">

    <t t-foreach="docs" t-as="o">

    <div class="page quotation">


        //My report style


     Some HTML




But when I want to print, odoo says me :

WebTemplateNotFound: Template 'report.custom_quotation' not found.

Maybe someone could help cause I can't see what is wrong in my code.

Akash Balar
On 3/14/16, 12:39 AM

Hello ,
Try this one, i think it's usable for you

Write down in report action file.

<template id="external_layout_custom">

    <t t-if="o and 'company_id' in o">

        <t t-set="company" t-value="o.company_id"></t>


    <t t-if="not o or not 'company_id' in o">

        <t t-set="company" t-value="res_company"></t>


    <t t-call="work_order.external_layout_header_custom" />

    <t t-raw="0" />


<template id="external_layout_header_custom">

    <div class="header" style="font-size:11px;">

            <div class="col-xs-12 text-right mt16">

                    Page: <span class="page"/>




External layout call in your custom report

<?xml version="1.0" encoding="utf-8"?>


    <template id="report_work_order">

        <t t-foreach="docs" t-as="o">

            <t t-call="work_order.external_layout_custom">

                <div class="page">..........</page>




Aurélien Rivet
On 3/12/16, 6:09 AM

Solved. It seems that I had misunderstood how odoo inheritance works. If I create an inherited template from an existing one, I haven't to call it using t-call attribute since it will be automatically called after its original.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 2/29/16, 9:22 AM
Seen: 1217 times
Last updated: 4/11/16, 1:10 PM