Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
9 Ответы
5885 Представления

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

Related Posts Ответы Просмотры Активность
1
авг. 23
5357
4
нояб. 24
7323
4
июл. 19
8238
0
дек. 18
3619
5
июн. 18
16721