跳至內容
選單
此問題已被標幟
1 回覆
1715 瀏覽次數

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 ?

頭像
捨棄
最佳答案

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


頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
4月 25
2810
1
4月 25
3558
1
4月 25
1132
4
3月 25
5990
2
2月 25
1983