Odoo Help


How to inherit purchase order body view?

Jeff Beidler
on 1/14/15, 7:34 PM 1,839 views

I have already created a module that inherits/overrides the default Sales Order view.  Works great.  I am now trying to do the same thing for Purchase Orders.  However, when I try to install my module, Odoo complains that it can't find the template to inherit from:

ParseError: "External ID not found in the system: purchase.report_purchasequotation_document"

My XML code looks like this:

<?xml version="1.0" encoding="utf-8"?>
        <template id="videx_po_body" inherit_id="purchase.report_purchasequotation_document">


The template is defined in the file "addons/purchase/views/report_purchasequotation.xml":

<template id="report_purchasequotation_document">

Why can't Odoo find the template to inherit?

--Ahmed M.Elmubarak--

Ahmed M.Elmubarak
On 3/8/15, 5:37 AM


You can use the template id to override it . e.g in the sale order report_saleorder.xml:

<template id="report_saleorder">
    <t t-call="report.html_container">
        <t t-foreach="doc_ids" t-as="doc_id">
            <t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'sale.report_saleorder_document')"/>

in your custom saleorder qweb you can use :

<template id="sale.report_saleorder">
    <t t-call="report.html_container">
        <t t-foreach="doc_ids" t-as="doc_id">
            <t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'your_module_name.your_template_id')"/>

I hope this could helps ...

Jeff Beidler
On 1/15/15, 11:44 AM

Well, by going to Settings-->Reports-->purchase.report_purchasequotation and clicking on the "Search associated Qweb views" link, I can see that "purchase.report_purchasequotation" is the only view ID listed.  So, that should be the view name to inherit from.  That view calls "purchase.report_purchasequotation_document" from within "<t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'purchase.report_purchasequotation_document')"/>", but I don't understand how this is different than the Sales Order views.  If I search associated Qweb views for "sale.report_saleorder", that screen lists both "sale.report_saleorder" and "sale.report_saleorder_document", but the latter is also called by the former in the file "report_saleorder.xml" : "<t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'sale.report_saleorder_document')"/>".  I would like to understand the difference!

--Edit-- Also, if I change the "inherit_id" to "purchase.report_purchasequotation",  then Odoo can find the template, but I am unable to override any of the elements inside of the sub-view "purchase.report_purchasequotation_document".  Odoo then complains that it can't find any of the referenced xpath elements, since the parent view contains only "t-" tags.  How can I override the elements of "purchase.report_purchasequotation_document"?

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

1 follower(s)


Asked: 1/14/15, 7:34 PM
Seen: 1839 times
Last updated: 3/16/15, 8:10 AM