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

@api.onchange('applicant_credential_id') 

 def _onchnage_applicant_credential_id(self): 

 res = {} 

 for rec in self: 

 if rec.applicant_credential_id: 

 rec.partner_name = rec.applicant_credential_id.full_name 

 rec.readonly_partner_name = True

 res['attrs']={'partner_name':{'invisible': [('readonly_partner_name', '=', True)]}} 

 else: 

 rec.readonly_partner_name = False 

 res['attrs']={'partner_name':{'invisible': [('readonly_partner_name', '=', False)]}} 

 return res

code is not working how i can write 

res['attrs']={'partner_name':{'invisible': [('readonly_partner_name', '=', False)]}} 

where is my mistake ?


الصورة الرمزية
إهمال
أفضل إجابة

Just use like this,

res['attrs']={'invisible': [('readonly_partner_name', '=', False)]}

الصورة الرمزية
إهمال
الكاتب

but this is incomplete bcz which field wil be invisilbe where i put ? like my field partner_name i want to invisible there is no place where i can put parent_name for invisible ....

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
أغسطس 23
2274
1
يوليو 23
2409
0
يوليو 23
2123
0
يوليو 23
1876
0
يناير 21
2992