this is my workaround for this, I added new a field is_organisme :
company_type = fields.Selection(string='Company Type',
selection=[('person', 'Individual'), ('company', 'Company'),('organisme', 'Organisme')],default='company',
compute='_compute_company_type', inverse='_write_company_type')
is_organisme = fields.Boolean(string='Organisme', default=False,
help="Check if the contact is an Organism, otherwise it is a company or a persone")
@api.depends('is_company')
def _compute_company_type(self):
for partner in self:
if partner.is_organisme and not partner.is_company:
partner.company_type = 'organisme'
elif partner.is_company and not partner.is_organisme:
partner.company_type = 'company'
else:
partner.company_type = 'person'
def _write_company_type(self):
for partner in self:
if self.company_type == 'company':
self.is_company = True
self.is_organisme = False
if self.company_type == 'person':
self.is_company = False
self.is_organisme = False
if self.company_type == 'organisme':
self.is_company = False
self.is_organisme = True
@api.onchange('company_type')
def onchange_company_type(self):
if self.company_type == 'company':
self.is_company = True
self.is_organisme = False
if self.company_type == 'person':
self.is_company = False
self.is_organisme = False
if self.company_type == 'organisme':
self.is_company = False
self.is_organisme = True
Hello Nikhil Nakrani
How do i get acces to the odoo Xml? do i need full admin rights?
Thanks and Best Regards
Guys, as Ray Carnes already explained is really not recommended to chage this logic (note: is possible indeed, is just not recommended).
If you do it you need to think that you may face several issue, not only to implementing it, but also at mantaining cause many other modules rely on this logic.
Personally I don't like the way it has been implemented, as extending this it's usually a common request. But it is what it is...