Skip to Content
Menu
This question has been flagged
1 Atsakyti
2983 Rodiniai

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 ?

Portretas
Atmesti
Best Answer

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


Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
5
rugs. 25
21590
3
rugp. 25
3114
1
bal. 25
3958
1
bal. 25
4845
1
bal. 25
2224