Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
4969 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona

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>

Autore

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.

Autore Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
3
feb 25
1935
1
dic 24
2083
2
mar 24
2428
2
mar 24
2957
0
set 23
1512