Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
1321 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Autor Nejlepší odpověď

I'm trying on vers 16.0

Avatar
Zrušit
Nejlepší odpověď

Hello Desi Shofiana Sari

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

Thanks

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
čvc 24
2155
1
čvc 23
4573
0
bře 24
3351
1
zář 22
6283
1
bře 22
6119