This question has been flagged
2 Replies
3261 Views

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
Discard
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
Discard

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>

Author

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.

Author 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
Discard