This question has been flagged
4306 Views

Hi,


First of all I'm on Odoo 8, I would like to add odoo8 tag but it seems that there has an issue with CORS for the ajax request of tags.

For some module of mines I want to include some custom css files in the printed layout. To achieve this I've made a custom report_layout and used it in my reports, with this I can easily edit header in the assets per submodule.

It's good for HTML report, but when it come to pdf the nightmare begin. As I've seen, the pdf action use another layout that can't be easily override :

 https://github.com/odoo/odoo/blob/8.0/addons/report/models/report.py#L216

render_minimal = partial(view_obj.render, cr, ui, 'report.minimal_layout', context=context)

 

The report.minimal_layout call a report.assets_pdf that include a style, I've tried to override this template but there is two problems with that :
- The first one is that it does nothing as if the override does not exist (probably a mistake of mine)

- The second one is that the modification will apply to all reports and that's not what I want


Is there a proper way to add custom css in pdf for some report only ? Note that I don't wan't to use inline style. I personnaly think that it could be fine to customize which layout need to be used for a pdf report as we can decide it for html report.


Thanks in advance

Avatar
Discard