Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
9 Risposte
5821 Visualizzazioni

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
Abbandona
Autore Risposta migliore

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
Abbandona
Risposta migliore

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

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

Autore

yes my module name is exploit_cnss and qweb template is report_cnss

Autore

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?

Autore

@Akhil do you pleasemention what you have changed

Post correlati Risposte Visualizzazioni Attività
1
ago 23
5213
4
nov 24
7235
4
lug 19
8196
0
dic 18
3580
5
giu 18
16682