Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
1625 Vizualizări

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 ?

Imagine profil
Abandonează
Cel mai bun răspuns

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


Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
apr. 25
2749
1
apr. 25
3512
1
apr. 25
1091
4
mar. 25
5915
2
feb. 25
1947