Hii
see my code below.
add_field.py
class CrmLead(models.Model):
_inherit = 'crm.lead'
add_portal_id = fields.Many2one('add.portal')
class AddPortal(models.Model):
_name = "add.portal"
_description = "Add Portal"
_rec_name = "add_portal_name"
add_portal_name = fields.Char(string='Add Portal Name', required=True)
add_field_view.xml
<record id="profile_field_form_inherit" model="ir.ui.view">
<field name="name">Add Profie Field</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_case_form_view_oppor"/>
<field name="arch" type="xml">
<field name="team_id" position="after">
<field name="add_portal_id" string="Portal Name"/>
</field>
</field>
</record>
The need of this post is, to sometime we need to visible invisible, readonly etc some filed on the basis of login user group or we want to perform some action on the basis of login user. To do so we need to get login user group: https://goo.gl/Ts3qqK
How to visible and invisible fields in odoo: https://goo.gl/BCxCpk