Skip to Content
Menú
This question has been flagged
3 Respostes
1338 Vistes

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

Avatar
Descartar
Best Answer

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.

Avatar
Descartar
Autor Best Answer

I'm trying on vers 16.0

Avatar
Descartar
Best Answer

Hello Desi Shofiana Sari

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

Thanks

Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
de jul. 24
2193
1
de jul. 23
4606
0
de març 24
3364
1
de set. 22
6292
1
de març 22
6145