跳至内容
菜单
此问题已终结
2 回复
4973 查看

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.

形象
丢弃
最佳答案

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

形象
丢弃

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>

编写者

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.

编写者 最佳答案

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

形象
丢弃
相关帖文 回复 查看 活动
3
2月 25
1938
1
12月 24
2083
2
3月 24
2428
2
3月 24
2958
0
9月 23
1514