Odoo Help


Images in webkit / mako pdf reports

on 5/15/13, 7:56 AM 3,862 views

How can one have images in webkit/mako reports? I have some trouble in getting them into reports, f.e. having this in .mako file does not work:

<div class="main_right">
    <img src="img/logo.png" alt=""/>

Image path is correct.


Daniel Reis

--Daniel Reis--
| 6 7 9
Lisbon, Portugal
--Daniel Reis--

Author of the "Odoo Development Essentials" book.

Applications Manager at Securitas Portugal

Github: https://github.com/dreispt

Twitter; @reis_pt

Daniel Reis
On 5/15/13, 8:13 AM

You can embed the image in the template text file using base64:

<img src="data:image/png;base64,[...base64 here...]" />

For example:

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" />

There are online services available that can convert your images to base64, like Web Coder Tools or base64-image.

Thank you! That solves the problem perfectly.

on 5/15/13, 10:05 AM
alfonso olavarria
On 5/20/13, 3:54 PM

embed this in your code mako. must clearly define the logo image settings - webkitlogos.

$ {helper.embed_logo_by_name ('cvg', width = 90)}



| 4 3 8
Delhi, India

Nothing to say .... :)

On 9/30/16, 8:14 PM

try like
<img width="250" src="data:image/png;base64,${object.image}"/>

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 platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 5/15/13, 7:56 AM
Seen: 3862 times
Last updated: 9/30/16, 8:14 PM