跳至内容
菜单
此问题已终结
9 回复
5680 查看

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.    

形象
丢弃
编写者 最佳答案

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

形象
丢弃
最佳答案

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'"
/>

 

形象
丢弃
编写者

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

编写者

yes my module name is exploit_cnss and qweb template is report_cnss

编写者

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?

编写者

@Akhil do you pleasemention what you have changed

相关帖文 回复 查看 活动
1
8月 23
5020
4
11月 24
7061
4
7月 19
8064
0
12月 18
3492
5
6月 18
16561