Search code examples
odooopenerp-8

Hide image tag odoo 9


On front end of page I use img tag for display binary image from database.

<img t-att-src="'data:image/png;base64,%s' % task.image" />

How hide tag if value is empty, now in my solution display small square.

https://i.sstatic.net/Un8fV.jpg


Solution

  • <t t-if="task.image">
        <img t-att-src="'data:image/png;base64,%s' % task.image"/>
    </t>