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

So I have this field for the widget:


```widget name="web_ribbon" title="REMISE IMPOSSIBLE" bg_color="bg-danger" class="ribbon ribbon-top-center" attrs="{'invisible': [('discount_rate_sale_count', '!=', True), ('discount_rate_sale_count', '!=', show_ribbon)]}"```


and this code:
    show_ribbon = fields.Boolean(string='Show Ribbon', compute='_compute_show_ribbon', store=True)

    @api.depends('sale')

    def _compute_show_ribbon(self):

        for record in self:

            record.show_ribbon = record.sale> (

                        record.total_price * 0.6) if record.total_price else False


But the ribbon didn't work

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

Hi,

Please try this attrs. 

attrs="{'invisible': [('sale', '!=', show_ribbon)]}"/>

Note: Just add the sale fields before the attrs field.

Up vote if its help you.

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

I'm trying on vers 16.0

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

Hello Desi Shofiana Sari

Can you tell me In which version you are trying this??

Thanks

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
يوليو 24
2144
1
يوليو 23
4567
0
مارس 24
3348
1
سبتمبر 22
6282
1
مارس 22
6111