تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
1587 أدوات العرض

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
أبريل 25
2743
1
أبريل 25
3506
1
أبريل 25
1084
4
مارس 25
5896
2
فبراير 25
1941