Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
136 Vizualizări

Hi.

How to add watermark in many pages of a report  - odoo 17
all what I have already tried stick the watermark on the first page only.

I need it to be automaticaly repeated based on pages number - and also to content to be based on the document state.

Imagine profil
Abandonează
Cel mai bun răspuns

Hi Jonathankabre1, 

<div style="opacity:0.15; font-size:100px; text-align:center; position:fixed; top:600px; right:100px; z-index:99; transform:rotate(-30deg);">

    <img t-if="doc.company_id.logo"

         t-att-src="image_data_uri(doc.company_id.logo)"

         style="max-width:80%; max-height:140pt; min-width:80%; min-height:50pt;"

         alt="Logo"/>

</div>


Try this 


Hope this helps.

Imagine profil
Abandonează
Cel mai bun răspuns

Hello jonathankabre1@gmail.com,



  Adding a watermark to every page of an Odoo report typically requires modifying the report's QWeb template to include the watermark in a way that it repeats on each page. Here’s how you can achieve this:

  First, inherit the report template you want to modify. You can do this in your custom module by creating a new QWeb view that inherits from the original report template.

  Next, within your inherited template, use CSS and HTML to position the watermark. Ensure the watermark is placed inside a container that repeats on each page. You might need to use CSS properties like `position: fixed;` to keep the watermark in a consistent location.

  To make the watermark dynamic based on the document state, use Odoo's QWeb templating engine to conditionally render the watermark text or image based on the document's state field. For example, you can use `t-if` directives to check the state and display different watermarks accordingly.

  Finally, remember that the reason your watermark might only appear on the first page is often due to how the report's layout is structured. Ensure your watermark element is not nested within a section that only renders once.


For personalized assistance:
https://www.pragtech.co.in/contact-us-mql.html

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
oct. 24
1502
4
nov. 24
7871
2
iul. 19
8704
2
iul. 25
2095
1
mar. 25
1542