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?

2
  • 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
    – ChesuCR
    Feb 26, 2018 at 16:49
  • No in Qweb report. i updated my question
    – Chaban33
    Feb 26, 2018 at 20:51

4 Answers 4

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)

1

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

5
  • i want to add a specific image not standard
    – Chaban33
    Feb 26, 2018 at 21:55
  • no problem add a boolean field to check the status of being checked or not. then if approved draw the image
    – kerbrose
    Feb 26, 2018 at 21:56
  • you can use t-if as suggested there odoo.com/documentation/10.0/reference/qweb.html
    – kerbrose
    Feb 26, 2018 at 22:00
  • is use <input type="checkbox" checked="True" style="text-align:center; vertical-align: middle;" /> to get original odoo checkbox. but my goal is to replace original image that odoo gives me.(black and white) with my image.
    – Chaban33
    Feb 27, 2018 at 7:35
  • so you need a css like the following w3schools.com/howto/…
    – kerbrose
    Feb 27, 2018 at 9:36
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
1
  • Yes it gives me original Odoo checkbox. Black and white. but i want to replace that original checkbox with my image
    – Chaban33
    Feb 27, 2018 at 7: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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.