القائمة

المساعدة

0

How to change icon color when available qty < 5

Avatar
Matija

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.

الصورة الرمزية
تجاهل
2الإجابات
1
أفضل إجابة

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

2التعليقات
الصورة الرمزية
تجاهل

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>

Avatar
Matija
-

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.

0
Avatar
Matija
أفضل إجابة

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

الصورة الرمزية
تجاهل