Skip to content

Commit

Permalink
[IMP] l10n_fr_chorus_account: add chorus service code in name_get()
Browse files Browse the repository at this point in the history
  • Loading branch information
alexis-via committed Jan 10, 2025
1 parent e97c272 commit e95b6be
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions l10n_fr_chorus_account/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,21 @@ def check_fr_chorus_service(self):
}
)

def _get_name(self):
name = super()._get_name()
if (
name
and self.fr_chorus_service_id
and not self._context.get("hide_chorus_service")
):
if "\n" in name:
field_label = _("Chorus Service Code:")
name = f"{name}\n{field_label} {self.fr_chorus_service_id.code}"

Check warning on line 106 in l10n_fr_chorus_account/models/res_partner.py

View check run for this annotation

Codecov / codecov/patch

l10n_fr_chorus_account/models/res_partner.py#L105-L106

Added lines #L105 - L106 were not covered by tests
else:
# We put it at the start, because it is cut if too long in M2O
name = f"(Chorus {self.fr_chorus_service_id.code}) {name})"
return name

def fr_chorus_api_structures_rechercher(self, api_params, session=None):
url_path = "structures/v1/rechercher"
payload = {
Expand Down

0 comments on commit e95b6be

Please sign in to comment.