Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
2551 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
3
août 25
2330
1
avr. 25
3517
1
avr. 25
4344
1
avr. 25
1823
4
mars 25
6964