Certainly, you can achieve that using views. Let’s consider a scenario where there is a « partner » domain with a many-to-one field called « user ». In the user domain, there is a many-to-one field called « activeCompany ».
To display the active company code in a readonly field on the partner form, you can add the following field in partner-form:
<field name="user.activeCompany.code" readonly="true" title="Active Company Code"/>
This field will retrieve the active company code from the associated user and display it in a readonly field on the partner form.
By following this approach, you can fulfill the requirement,
If you have any further questions or need additional assistance, please feel free to ask.