콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
3714 화면

Simple question: I am trying to generate a simple XML report. I compared the code of several modules which do that, but I am not able to undestand what I have to write in the property name. I tried a lot of things comparing to the other files, but no one was succesful, because I am always getting this error:

except_osv: (u'report.what_I_write_in_name', (<type 'exceptions.KeyError'>, KeyError(u'report.what_I_write_in_name',), <traceback object at 0x7f21302f4f80>))

The name of my module is res_partner_extended. It has a folder called report, and inside it I have the XML file reports.xml, which indicates the reports to use. Here is where I have the code which generates the error:

        <report id="report_res_partner_link_category_history"
                model="res.partner.link.category"
                name="¿¿¿???"
                string="Inade links"
                xml="res_partner_extended/report/res_partner_link_category_history.xml" />

Still inside the folder report, I also have the XML file with the content of the report (to be displayed). Its name is res_partner_link_category_history.xml.

What do I have to write in name? Thank you in advance.

아바타
취소
베스트 답변

The name is name of the report you defined in your report .py file after the "report." string. So, you have to check your corresponding report python file.
 

아바타
취소
작성자

So, I have this in the .py : report_sxw.report_sxw('report.rplc_history', 'res.partner.link.category', 'addons/res_partner_extended/report/res_partner_link_category.rml', parser="res_partner_link_category_history", header="external")..... I have to write rplc_history as the name?

베스트 답변

I have a working module for internal use which has this: name="my_module_name.my_reports_template_id". Have you tried that?

[EDIT]

BTW, this is for a qweb report definition in V8

아바타
취소
작성자

Thank you Ludo! No, I hadn't tried with that one yet. But, what is exactly the report template id?

In the case of qweb you create an XML for your report. It starts with the tag something like . That is the one I mean in this case. Could be different for other reports.