Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
9049 Visualizzazioni

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
Abbandona
Autore

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

Risposta migliore

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
Abbandona
Risposta migliore

Hi,

How can I insert a background image into the structure of the xml document chosen as the basis for the various modules? For example, I would like to modify the structure of the "external_layout_boxed" xml document from "Settings", where can I intervene in the code to insert a full-page image? The page format of the document is A4.

Thank you!

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
nov 23
3401
1
ott 22
6217
0
lug 22
9
0
ott 22
3316
1
ago 22
4863