تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
3183 أدوات العرض

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.


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

@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


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

Hello Matija

May be below module will helpful for you.

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

الصورة الرمزية
إهمال

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

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
مارس 22
1062
0
مارس 22
2
0
مارس 22
2
0
مارس 22
7
3
فبراير 25
2004