Odoo Help

Welcome!

This community 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.

0

QWebTemplateNotFound: External ID Not found in the system : purchase_qweb.report_purchase_order_template

By
Mohammed Khamis
on 2/9/15, 1:55 AM 1,260 views

I am start working on Qweb report on odoo V8 but when i run this report I get this error and my code 

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <template id="report_purchase_order_document">
            <t t-call="report.external_layout">
                <!--VARIABLES TO BE USED LATER-->

                <!-- CALLING HEADER and FOOTER -->
                <t t-call="report.external_layout_header"/>
                <t t-call="report.external_layout_footer"/>

                <div class="page">
                   <t t-foreach="objects" t-as="o">
                           <t t-set="j" t-value = "0" />
                   <t t-foreach = "o.order_line" t-as = "line" >
                           <t t-set="j" t-value = "j+1" />
                   </t>
                           <br/>
                   <t t-foreach = "o.order_line" t-as = "line" >
                           <t t-set="count" t-value = "0" />
                   </t>
                   <table class="basic_table" width="100%">
                      <tr><td colspan='4'><b><u><center>Purchase Order </center></u></b></td></tr>
                      <tr>
                          <td align="left" style="padding-left:5px" width= "25%" font-size="1px" > 
                              Date
                          </td>
                          <td align="left" style="padding-left:5px" width="25%" >
                             <t t-esc = "o.date_order" />
                          </td>
                          <td align="left" style="padding-left:5px" width="25%" font-size="1px">Serial No.</td>
                          <td align="left" style="padding-left:5px" width="25%" font-size="1px" ><t t-esc="o.name" /> </td>
                    
                      </tr>

                      <tr>
                          <td align="left" style="padding-left:5px" width="25%" font-size="1px" > 
                             Phone         
                          </td>

                          <td align="left" style="padding-left:5px" width="25%"><t t-esc="o.partner_id.phone" /> </td>
                          <td align="left" style="padding-left:5px" width="25%" font-size="1px">Fax</td>
                          <td align="left" style="padding-left:5px" width="25%" font-size="1px" ><t t-esc="o.partner_id.fax" /> </td>
                      </tr>
                      <tr>
                        <td colspan='4'><b ><u><center>Item List (Total Items : <t t-esc="count" /> )</center></u></b></td>
                      </tr>
                  </table>
 
                 </t>
                           
                </div>
              </t>
        </template>

        <template id="report_purchase_order_template">
            <t t-call="purchase_qweb.html_container">
                <t t-set="doc_id" t-value="doc_ids[0]"/>
                <t t-raw="translate_doc(doc_id, doc_model, 'company_id.partner_id.lang', 'purchase_qweb.report_purchase_order_document')"/>
            </t>
        </template>
    </data>
</openerp>


and in xml view 


<report
            auto="False"
            id="action_report_purchase_order"
            model="purchase.order"
            name="purchase_qweb.view.report_purchase_order_templat"
            file="purchase_qweb.report_purchase_order_template"
            string="Purchase OrderQ"
            report_type="qweb-pdf"
            multi="True"
            attachment_use="0"
            attachment=""
            menu="False"
            />

please help me how can i solved this problem,

thank you so much

 

Shawn I removed view and write report.html_container but still not working

Mohammed Khamis
on 2/9/15, 3:46 AM
0

Ankit H Gandhi(AHG)

--Ankit H Gandhi(AHG)--
996
| 5 3 6
Rajkot, India
--Ankit H Gandhi(AHG)--

Learning Python..

Ankit H Gandhi(AHG)
On 2/9/15, 4:15 AM

Hello Mohammed Khamis,

     Try this code in xml file may be helpfull

     <report id="action_report_purchase_order"
                string=""Purchase OrderQ"
                model="purchase.order"
                report_type = "qweb-pdf"
                file="purchase_qweb.report_purchase_order_document"
                name="purchase_qweb.report_purchase_order_document" />

if you find this answer helpfull, please give me a thumbs up vote    

Thanks & Regards,

Ankit H Gandhi

0
Shawn Varghese
On 2/9/15, 2:50 AM

I'm assuming your module is called purchase_qweb.

In the XML view, you've written

file="purchase_qweb.view.report_purchase_order_template"

Try removing the .view, and make it like this

file="purchase_qweb.report_purchase_order_template"

 

Also, I noticed in this statement,

<t t-call="purchase_qweb.html_container">

I normally use report.html_container instead. Not sure if that makes a difference. But change the file name as mentioned above and test it first. It should resolve your issue.

Let us know if this doesn't resolve the issue.

Shawn Varghese
on 2/9/15, 2:51 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 2/9/15, 1:55 AM
Seen: 1260 times
Last updated: 3/16/15, 8:10 AM