Skip to Content
Menu
This question has been flagged
5 Replies
6464 Views

Hi everyone,
I'm trying to display pictures in a custom module, using the <img> tag. Though the access path to the picture is correct, they are not displayed. I saw on the forum that other people had the some with Odoo 9,  I tried to install and  upgrade Werkzeug but it didnt fix the problem. Any help would be appreciated.
Thanks in advance.

Avatar
Discard
Best Answer

Hi, Before module_name put / and try

<form string='Class'>
 <sheet>
 <group>
 <img src='/module_name/static/image/myimage.png'>
    <field name='name'/>
 </img>
 </group>
 </sheet>
</form>
Avatar
Discard
Best Answer

I don't know where you place your image in module. You must place your image in your module to work. I have code that works form me.

So, try it

in xml file i used <img> tag like this,

<form string='Class'>
    <sheet>
         <group>
            <field name='name'/>
            <img src='module_name/static/image/myimage.png'/>
        </group>
    </sheet>
</form>
Avatar
Discard
Author

Hi Bharat, my code looks exactly like yours but my image is still not displayed, I really dont get it. Below is my code :

<form string="Accueil" class="accueil_form" encoding="UTF-8">

<sheet>

<div>

<p> <a class="a_accueil" href="url">Accès à l'ERP</a> </p>

<p> <a class="a_accueil" href="url">Pydio</a> </p>

<p> <a class="a_accueil" href="url">Site vitrine </a> </p>

<sheet>

<group>

<field name="img"/>

<img src='accueil/static/odoo.png'/>

</group>

</sheet>

</div>

</sheet>

</form>

Author

There is a mistake in the code above (2 <sheet> tags, but it's not the reason for my problem).

Best Answer

Go on http://www.pinterest.com

Avatar
Discard