0

Is there way to change checkbox image in qweb report. For example i want to change standard "V" to image like this:

enter image description here

Is it possible?

ChesuCR
  • 9,352
  • 5
  • 51
  • 114
Chaban33
  • 1,362
  • 11
  • 38
  • I don´t understand very well, do you mean in the tree view? If you want to add images to the qweb report check [this other question](https://stackoverflow.com/questions/33340909/how-to-print-images-in-custom-qweb-reports-in-odoo#33364315) – ChesuCR Feb 26 '18 at 16:49
  • No in Qweb report. i updated my question – Chaban33 Feb 26 '18 at 20:51

4 Answers4

3

Solution 0

Add the file to your module, for example store it in the path /module_name/static/src/img/image_name.png

Then now you can add the image to the Qweb Report:

<img t-att-src="'/module_name/static/src/img/image_name.png'" />

Note: respect the order and the type of the quotes

Solution 1

Maybe it is useful to create ul html list with all the elements you want to add:

<style>
    .icon_list {
        list-style-image: url('/module_name/static/src/img/image_name.png');
    }
</style>

<!-- [...] -->

<ul class="icon_list" >
    <li>Coffee</li>
    <li>Tea</li>
    <li>Coca Cola</li>
</ul>

(I didn´t try it but it should work as well)

ChesuCR
  • 9,352
  • 5
  • 51
  • 114
1

you can simply replace it with the standard Unicode character by a field that is checking the status

kerbrose
  • 1,095
  • 2
  • 11
  • 22
1

Please use "input type as checkbox". It worked for me.

<input type="checkbox" checked="checked"/>I agree that glasses are selected based on my indications
sfx
  • 1,793
  • 17
  • 24
  • Yes it gives me original Odoo checkbox. Black and white. but i want to replace that original checkbox with my image – Chaban33 Feb 27 '18 at 07:14
1

in odoo11 you can choose this class for checkbox

i class="fa fa-check which opening and closing tags This gives better checkbox than default in odoo

code_explorer
  • 472
  • 6
  • 18