Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
2970 Weergaven

I want to change some fields label using  _get_view() method. But it should be based on @api.onchange. when i try to add api.onchange decorator then this error showing 

    if res.get('value'):

AttributeError: 'str' object has no attribute 'get'


Is there any solution for this ?

Avatar
Annuleer
Beste antwoord

Hi,


The @api.onchange decorator is typically used to trigger a method when the value of a field changes.

If you're trying to dynamically change field labels based on some condition, you might consider using the _get_view() method instead.

arch, view = super()._get_view(view_id, view_type, **options)


Hope it helps


Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
5
sep. 25
21467
3
aug. 25
3083
1
apr. 25
3948
1
apr. 25
4819
1
apr. 25
2214