Ir al contenido
Menú
Se marcó esta pregunta
9 Respuestas
5748 Vistas

Hello everybody!!

Cananyone help me please know the sourceof this bug.

I am creating a new report but when i click on print i got an error:

QWebTemplateNotFound: External ID not found in the system: exploit_cnss.report_cnss

Here is my python:

.

.

.

class wrapped_report_cnss(osv.AbstractModel):

    _name = 'report.exploit_report.report_cnss2' _inherit = 'report.abstract_report' _template = 'exploit_report.report_cnss2' _wrapped_report_class = report_cnss2

aand xml:

<report id="action_report_cnss" model="exploit.cnss" string="Déclaration CNSS Trimestre 1" report_type="qweb-pdf" name="exploit_cnss.report_cnss" file="exploit_cnss/report/report_cnss.xml" attachment_use="True" attachment = "'%s.pdf'%'Déclaration CNSS Trimestre 1'" />

Need help my friends.

Best Regards.    

Avatar
Descartar
Autor Mejor respuesta

Finally,i got the solution but i dont know why.

May be it was because of the copy and paste manner.

So, the problem was that ODOO didnt see the report folder.

That's why it couldnt find the template.

I have deleted the folder  and put my templates directly under the module and call them in my __opener__.py file.

Now everything works fine :)

Thanks very much my friend @Akhil ;)

Avatar
Descartar
Mejor respuesta

Hi,

I hope the report template id is report_cnss, then you may try the following:

class report_cnss(osv.AbstractModel):

    _name = 'report.exploit_cnss.report_cnss' 
    _inherit = 'report.abstract_report'
    _template = 'exploit_cnss.report_cnss'
    _wrapped_report_class = report_cnss2

in xml:

<report 
    id="action_report_cnss"
    model="exploit.cnss"
    string="Déclaration CNSS Trimestre 1"
    report_type="qweb-pdf"
    name="exploit_cnss.report_cnss"
    file="exploit_cnss.report_cnss"
    attachment_use="True"
    attachment = "'%s.pdf'%'Déclaration CNSS Trimestre 1'"
/>

 

Avatar
Descartar
Autor

Thanks a lot for theanswer but i still have this error : QWebTemplateNotFound: External ID not found in the system: exploit_cnss.report_cnss

Your module name is "exploit_cnss" right? And the qweb template id is "report_cnss" or "report_cnss2"?

Autor

yes my module name is exploit_cnss and qweb template is report_cnss

Autor

i have changed the last line to _wrapped_report_class = report_cnss

That should be name of class extending "report_sxw.rml_parse" which is defined in your parser file. I made a small change in answer. Can you try now?

Autor

@Akhil do you pleasemention what you have changed

Publicaciones relacionadas Respuestas Vistas Actividad
1
ago 23
5107
4
nov 24
7151
4
jul 19
8127
0
dic 18
3527
5
jun 18
16626