<field name="readonly_partner_name" invisible="1" />
<xpath expr="//field[@name='partner_name']" position="attributes">
<attribute name="attrs">{'readonly':[('readonly_partner_name','!=', False)]}</attribute>
</xpath>
@api.onchange('applicant_credential_id')
def _onchnage_applicant_credential_id(self):
for rec in self:
if rec.applicant_credential_id:
rec.partner_name = rec.applicant_credential_id.full_name
rec.readonly_partner_name = True
else:
rec.readonly_partner_name = False
not giving me result where i'm wrong