Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3 Antwoorden
1346 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Auteur Beste antwoord

I'm trying on vers 16.0

Avatar
Annuleer
Beste antwoord

Hello Desi Shofiana Sari

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

Thanks

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
jul. 24
2199
1
jul. 23
4625
0
mrt. 24
3373
1
sep. 22
6302
1
mrt. 22
6163