Hi Team,
I am new to Odoo, could you please help me understand which is the standard approach to add new fields to an odoo delivered model.
Say, if I need to create two new additional fields (profession and hobby) to existing CRM_LEAD model.
I understand that the basic approach is to add those new fields to the _inherit object of CRM_LEAD model
class AddNewfield(models.Model):
_inherit = "crm.lead"
Profession = fields.Char('Profession', size=20, required=True)
Hobby = fields.Char('Hobby', size=20)
But I had come across article stating that its not advisable to add new fields to odoo delivered model, as this might impact future upgrade.
Then, should I have to build a new model adding these two fields and a many2one field to the parent table.
class AddNewModel(models.Model):
_name = "crm.AddNewModel"
Profession = fields.Char('Profession', size=20, required=True)
Hobby = fields.Char('Hobby', size=20)
lead_id = fields.Many2one('crm.lead', required=True)
Let me know if which is the right approach.
As well how will I be able to display the new fields from model crm_AddNewModel in the Leads standard form view.
1st approach is right one, but create a new module for do those changes don't do in "CRM" or any standard module.