Skip to Content
Menu
This question has been flagged
1 Reply
4463 Views

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


Avatar
Discard
Best Answer

Just use like this,

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

Avatar
Discard
Author

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 Replies Views Activity
2
Aug 23
911
1
Jul 23
1045
0
Jul 23
965
0
Jul 23
943
0
Jan 21
2096