Skip to Content
Menú
This question has been flagged
2 Respostes
4965 Vistes

Hi all,

when creating sales order there is graph icon that turns red if product is not available (0 on stock) and we would like this icon to change color to yellow when Available qty reaches less than 5. Here it is on video https://recordit.co/28lvKWOy53

Can anyone help please.

Avatar
Descartar
Best Answer

Hello Matija,

To change the icon color to yellow when available quantity less then five you need to replace div named "sale_stock,qtyAtDate" defined in sale_stock.xml file of sale_stock module which you can find in odoo addons.

Code is in the Comment box.

Hope it will help you.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Descartar

To change the icon color to yellow when available quantity less then five you need to replace div named "sale_stock,qtyAtDate" defined in sale_stock.xml file of sale_stock module which you can find in odoo addons.

<div t-name="sale_stock.qtyAtDate">
<div t-att-class="!widget.data.display_qty_widget ? 'invisible' : ''">
<a tabindex="0" t-attf-class="fa fa-area-chart {{ widget.data.forecasted_issue ? 'text-danger' :
widget.data.qty_available_today > 5 ? 'text-primary' : 'text-warning' }}"/>
</div>
</div>

Autor

Jainesh, thank you for your help - this works.

I actually knew that location of this line is in sale_stock.xml but I tried to change it via my module that would replace this div.

In my module I created xml file with this code:
https://ibb.co/gvms55p

Unfortunately it didn't change it - I must be doing something wrong here with inheritance :/
Do you know how to make this work in my module? Thanks.

Autor Best Answer

Ok to answer my other question on how to implement this in my custom module is this - just put this code in you XML file inside static/src/xml

https://ibb.co/zh0GcpN

Avatar
Descartar
Related Posts Respostes Vistes Activitat
3
de febr. 25
1935
1
de des. 24
2083
2
de març 24
2428
2
de març 24
2956
0
de set. 23
1512