Skip to Content
Menu
This question has been flagged
1 Reply
6050 Views

Hi,


The company have specific graphical charter, for the letterheads an so on.

Reproducing it with QWeb, and inheritance would be very complex.


I thought I might go with the correct template as an image (having logo, adress, ... with correct fonts, size, ...) as picture, and use background feature.


Unfortunately, the background is only in the body of the reports. headers and footers are not considered.

Still, I think I could make some inheritance to have it whole page. But doesn't seem to work.

There's always this space for headers and footer, even when I do a "position=replace" of that div.

Any directions?

Avatar
Discard
Author

For the record, this is an SaaS instance, so I'm creating a view that inherits from standard views.

Best Answer

To use an image as the background for the entire page of a report in Odoo, you can try the following approach:

  1. Create a new QWeb report using the "Add a custom report" option in the Developer mode.

  2. In the report template, add a

    element with the desired image as the background. Set the position style to absolute and the z-index style to -1, so that the content of the report is displayed on top of the background image.
    Copy code
    position: absolute; z-index: -1;"> src="/path/to/image.jpg" style="width: 100%; height: 100%;"/>
    1. To make the background image fill the entire page, including the header and footer, you can set the height style of the
      element to 100% and the width style to 100%.
      Copy code
      position: absolute; z-index: -1; height: 100%; width: 100%;"> src="/path/to/image.jpg" style="width: 100%; height: 100%;"/>
      1. If you want to use an image as the background for only a specific report, you can create a new view that inherits from the standard report view, and add the
        element with the background image in the new view.
        Copy code
            
                .template_id">
                    [@class='page']" position="inside">
                        
        position: absolute; z-index: -1; height: 100%; width: 100%;"> src="/path/to/image.jpg" style="width: 100%; height: 100%;"/>

        I hope this helps. Let me know if you have any questions or if you need further assistance.


Avatar
Discard
Related Posts Replies Views Activity
0
Nov 23
2039
1
Oct 22
3968
0
Jul 22
9
0
Oct 22
1997
1
Aug 22
3196