Skip to Content
Menu
This question has been flagged
2 Replies
2347 Views

Hi people,


I'm trying to change color of Forecasted Widget in Sales Order view. I figured it is defined in this location odoo/addons/sale_stock/static/src/xml/sale_stock.xml this part of code: 

https://ibb.co/FB6xCXP

I created custom module and tried to replace above code with my version like this (it should be red when Available Qty = 0, Yellow when Available Qty < 5 and green when Available Qty > 5) but with no luck

https://ibb.co/9hG4JWS

This file is located in static/src/forecast_widget.xml and in manifest file it's called through 'qweb': [ 'static/src/xml/forecast_widget.xml', ]

Can anyone please guide me where I made mistake? Thank you!

P.S. - My code isn't showing up on questions so I used ImgBB to upload pictures of code.


Avatar
Discard
Author Best Answer

@Jainesh you helped me here on other post with this, if someone needs help check answers here 
- this solution you gave here didn't work for some reason

https://www.odoo.com/forum/help-1/how-to-change-icon-color-when-available-qty-5-199954


Avatar
Discard
Best Answer

Hello Matija

May be below module will helpful for you.

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

Avatar
Discard

<templates id="template" xml:space="preserve">

<t t-extend="sale_stock.qtyAtDate">
<t t-jquery="div" t-operation="replace">
<div t-att-class="!widget.data.display_qty_widget ? 'invisible' : ''">
<t t-if="widget.data.forecasted_issue">
<t t-if="widget.data.comfirm_po_move">
<a tabindex="0" t-attf-class="fa fa-area-chart text-warning"/>
</t>
<t t-else="">
<a tabindex="0" t-attf-class="fa fa-area-chart text-danger"/>
</t>
</t>
<t t-else="">
<a tabindex="0" t-attf-class="fa fa-area-chart text-primary"/>
</t>
</div>
</t>
</t>
</templates>

Related Posts Replies Views Activity
0
Mar 22
397
0
Mar 22
2
0
Mar 22
2
0
Mar 22
7
1
Dec 24
187