Odoo Help

0

Reports, keep getting errors "QWebTemplateNotFound: External ID not found in the system" or "IndexError: list index out of range"

By
aydunno
on 11/5/15, 11:04 AM 1,582 views

I created the report, taking the following steps, as stated in the tutorial (I also created the module from the tutorial and there the report works):

- reports.xml in the data list

- added code in reports.xml:

<openerp>

    <data>

        <report

        id="report_idtest"        

        model="pprepair.ppmain"    

        string="Ppreport"

        report_type="qweb-pdf"

        name="pprepair.report_idtest_name"    

        />


        <template id="report_idtest_name">    

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

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

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

                        <div class="page">

                            <h2>Report title</h2>

                        </div>

                 </t>

            </t>

         </t>

        </template>

    </data>

</openerp>

thats it. when I change the attribute "name" to the value of "pprepair.report_idtest_name", I get error with "QWebTemplateNotFound" and when I change it to the value ""pprepair.report_idtest" I get error with "IndexError".

I tried it on Odoo 9, because I read that it could be a bug and get the same behavior.

I may be overlooking a detail, this is driving me nuts.

2
Axel Mendoza
On 11/5/15, 12:41 PM

Hi @aydunno

You need to change your report declaration to this:

  <report
id="report_idtest"
model="pprepair.ppmain"
string="Ppreport"
report_type="qweb-pdf"
name="module.report_idtest_name"
/>

==================update====================

 replace module in the report attr name with the module where the report is defined

already tested, see the answer update

Axel Mendoza
on 11/12/15, 4:15 AM

the module name as it appears on the filesystem, not the name give within the class. okay, it works now, thanks!!

aydunno
on 12/1/15, 5:27 AM
0
aydunno
On 11/5/15, 3:11 PM

thanks Axel Mendoza

i tested on the odoo 8 instance and it makes no difference.

I used http://localhost:8069/report/pdf/pprepair.report_idtest_name/1 and http://localhost:8069/report/pdf/report_idtest_name/1 to call.


In setting > reports, the reports exist, in case I forgot to mention that.

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.

Register

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)

Stats

Asked: 11/5/15, 11:04 AM
Seen: 1582 times
Last updated: 12/1/15, 5:27 AM