base_company_extension: handle case where company legal type is already in company name

This commit is contained in:
Alexis de Lattre
2024-11-19 15:28:59 +00:00
parent a2952ca6b2
commit 59c7084159

View File

@@ -15,7 +15,7 @@ class ResCompany(models.Model):
def _report_company_legal_name(self):
self.ensure_one()
if self.legal_type:
if self.legal_type and not self.name.endswith(self.legal_type):
name = '%s %s' % (self.name, self.legal_type)
else:
name = self.name