Skip to Content
Menu
This question has been flagged
2 Replies
3617 Views

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.

Avatar
Discard
Best Answer

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.
 

Avatar
Discard
Author

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?

Best Answer

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

Avatar
Discard
Author

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.