Skip to Content
Menu
This question has been flagged
9 Replies
4828 Views

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
Discard
Author Best Answer

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
Discard
Best Answer

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

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

Author

yes my module name is exploit_cnss and qweb template is report_cnss

Author

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?

Author

@Akhil do you pleasemention what you have changed

Related Posts Replies Views Activity
1
Aug 23
2752
4
Nov 24
5744
4
Jul 19
7096
0
Dec 18
2623
5
Jun 18
15351