Skip to content

Commit

Permalink
[FIX] l10n_es_partner: Mantengo el parámetro default como estaba inic…
Browse files Browse the repository at this point in the history
…ialmente, añado return y elimino líneas en blanco
  • Loading branch information
JuaniFreedoo committed Dec 18, 2024
1 parent 4d0215b commit 5f661bc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions l10n_es_partner/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ class ResPartner(models.Model):
comercial = fields.Char("Trade name", size=128, index="trigram")
display_name = fields.Char(compute="_compute_display_name")


@api.depends("comercial")
@api.depends_context("no_display_commercial")
def _compute_display_name(self):
name_pattern = (
self.env["ir.config_parameter"]
.sudo()
.get_param("l10n_es_partner.name_pattern", default="%(comercial_name)s %(name)s")
.get_param("l10n_es_partner.name_pattern", default="")
)
no_display_commercial = self.env.context.get("no_display_commercial")
for partner in self:
Expand All @@ -29,7 +28,7 @@ def _compute_display_name(self):
"name": partner.display_name,
"comercial_name": partner.comercial or "",
}

return True

@api.model
def _commercial_fields(self):
Expand Down

0 comments on commit 5f661bc

Please sign in to comment.