Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


QWEB: Place full width image on page

Shawn Varghese
on 7/10/16, 3:35 PM 299 views

I would like to place an image in QWEB report that stretches right to the ends of the page on both sides . I tried setting Left and Right page margins to 0 in the Paper Format, but even then there is a small white space left on either side. Does any one know how this can be done?


Axel Mendoza

--Axel Mendoza--
| 6 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 7/10/16, 9:24 PM

For that you need to extend the report layout minimal_layout to control when the report body needs the container class or not, because that is the responsible for that issue or requirement that you have. You could do something like this:

<template id="custom_minimal_layout" inherit_id="report.minimal_layout">

<xpath="//body" position="replace">

<t t-set="need_container" t-value="False"/>

<body class="container" onload="subst()" t-if="need_container">

<t t-raw="body"/>


<body onload="subst()" t-if="not need_container">

<t t-raw="body"/>




Make sure to provide a valid condition to set the need_container var a True/False value when it's a normal report that need the container class or not. This was an example, you could do the same with t-attf-class and related but it's less clear for the example. The template "report.minimal_layout"  is directly used by  the report model get_html method. 


This is great, thanks Axel. But could you please tell me a little bit more about the condition i.e. what condition to use to dynamically set it as True / False depending on the report?

Shawn Varghese
on 7/11/16, 4:21 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 7/10/16, 3:35 PM
Seen: 299 times
Last updated: 7/11/16, 4:21 AM