Add multiple headers for reportingby Elico Corp
This extension to Base module simply adds multi-header capabilities for reporting with a dedicated report header's table. Initially this module aims at adding extra landscape headers for external documents (in base module, only 3 headers are available in the company definition: 1 for external docs and 2 for internal), which is a problem if you have external reports both in portrait and landscape mode.
HOW IT WORKS
A specific table res_header stores the headers in rml format (same as in the company definition). To be filled in Administration/Reporting/Reporting Headers.
This module gives an example of wrapping the function to use the specific table. _add_header(self, rml_dom, header='external')
Check the report example given in the module to see how to add _add_header() function to your own reports. Once added, you will be able to create and use different header in the following function calls:
report_sxw.report_sxw('report.name', 'model.name', 'path_to_rml/report.rml', parser=parser_function, header='name_of_header)
On top of current headers ('internal', 'external' and 'internal landscape'), you can specify for 'header=' whatever header's name you created in the report header's table located in Administration/Reporting/Reporting Headers.
- 'internal', 'external' and 'internal landscape' are OpenERP reserved name
- You have to manually fill in the headers in the interface (2 default entries are added in the database though)
(an ready-to-use header example is given in the file l10n_cn_report_header_example.xml)
- add multi-company capability
- generate default entries for the table res_header.