Skip to content

Commit

Permalink
Merge PR #4058 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Mar 4, 2025
2 parents 6055734 + dc3ec19 commit 7ce4823
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions l10n_es_partner/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2009 Jordi Esteve <[email protected]>
# Copyright 2012-2014 Ignacio Ibeas <[email protected]>
# Copyright 2016 Tecnativa - Carlos Dauden
# Copyright 2016-2022 Tecnativa - Pedro M. Baeza
# Copyright 2016,2022,2025 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3).
from odoo import api, fields, models

Expand Down Expand Up @@ -49,6 +49,9 @@ def _commercial_fields(self):
res += ["comercial"]
return res

def _auto_init(self):
self.env["res.partner"]._rec_names_search.append("comercial")
return super()._auto_init()
@api.model
def name_search(self, name="", args=None, operator="ilike", limit=100):
# Inject the field comercial in _rec_names_search if not exists
if "comercial" not in self._rec_names_search:
self._rec_names_search.append("comercial")
return super().name_search(name=name, args=args, operator=operator, limit=limit)

0 comments on commit 7ce4823

Please sign in to comment.