Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5338 มุมมอง

@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 ....

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ส.ค. 23
2397
1
ก.ค. 23
2548
0
ก.ค. 23
2212
0
ก.ค. 23
1999
0
ม.ค. 21
3098