Hello !
i have this message when i try to print a report :
QWebTemplateNotFound: External ID not found in the system: manage_candidates.report_candidates
my code :
in view/candidates.xml
...
<report
id="report_candidates"
model="manage_candidates.candidate"
string="Liste des candidates"
report_type="qweb-pdf"
name="manage_candidates.report_candidates"
file="manage_candidates.report_candidates"
attachment_use="True"
/>
In candidate_report.py :
from openerp import api, models
class ParticularReport(models.AbstractModel):
_name = 'report.manage_candidates.report_candidate'
@api.multi
def render_html(self, data=None):
report_obj = self.env['report']
report = report_obj._get_report_from_name('manage_candidates.report_candidate')
docargs = {
'doc_ids': self._ids,
'doc_model': report.model,
'docs': self, }
return report_obj.render('manage_candidates.report_candidate', docargs)
in template_candidates_report :
<?xml version="1.0" encoding="utf-8"?>
<!--Custom report.-->
<openerp>
<data>
<!-- translate template -->
<template id="report_candidate_document">
<t t-call="report.external_layout">
</t>
</template>
<!-- main template -->
<template id="report_candidate">
<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','manage_candidates.report_candidate_document')"/>
</t>
</t>
</template>
</data>
</openerp>
in __openerp__.py
'data':
[
"views/template_jury_report.xml",
'views/template_candidates_report.xml',
'templates.xml',
'views/menu.xml',
'views/candidate.xml',
'views/jury.xml',
'views/teacher.xml',
'views/interview.xml',
'views/classroom.xml',
'views/configuration.xml',
'demo/candidate_data.xml',
'demo/teacher_data.xml',
'demo/jury_data.xml',
'demo/config_data.xml',
'demo/classroom_data.xml',
],
int __init__.py :
# -*- coding: utf-8 -*-
import controllers
import teacher
import jury
import candidate
import interview
import classroom
import configuration
import candidates_report
import jury_report