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

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

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
srp 25
2770
1
dub 25
3710
1
dub 25
4573
1
dub 25
2022
4
bře 25
7194