Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
3 Ответы
1313 Представления

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

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
июл. 24
2144
1
июл. 23
4567
0
мар. 24
3348
1
сент. 22
6282
1
мар. 22
6111