0

To learn about creating modules, I did the odoo tutorial, which is a guide to create a sample module - this report works.

I followed the exact same steps to create the report in my module and it is not working, I keep getting this error when accessing it via the reports url:

"QWebTemplateNotFound: External ID not found in the system: pprepair.report_idtest_name".

I read about this problem that it could be a bug in the version I was using, so I updated to the recently released Odoo 9 but still get the same error. Different text, but same problem: ID could not be found.

I checked in the settings and the report is there. So it was created correctly, but somehow, it could not be accessed.

Perhaps I am missing somehting.

Attached is my code, please help.

<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>
aydunno
  • 91
  • 10

2 Answers2

0
<openerp>
<data>


<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>


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


</data>
</openerp>

Define template before calling it in report tag. Swap them.

Rutul Raval
  • 313
  • 2
  • 10
  • Tried it, no difference – aydunno Nov 04 '15 at 11:25
  • Did you upgrade the module after performing these changes .? You can UPGRADE your module by command line ---> ./odoo.py -d db_name --db-filter db_name -u module_name Or you can manually go in Apps and Upgrade from there. When you change any XML file you must UPGRADE. – Rutul Raval Nov 04 '15 at 11:39
  • yes i did, i work a while on the module, and its done for the most part, so I know the basics. the reports are the last thing on the list... – aydunno Nov 04 '15 at 13:01
0

When you create a report action using the report shortcut like following:

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

The name value should be modulename.report_id.

Kenly
  • 24,317
  • 7
  • 44
  • 60