Skip to content

Commit

Permalink
feat: ignore spaces and dashes around name when matching partner
Browse files Browse the repository at this point in the history
  • Loading branch information
Clément committed Aug 27, 2024
1 parent 38f03ac commit 5dda2fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions partner_auto_match/models/res_partner_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def match_values_to_partner(self, vals, match_update=False, match_create=True):
continue

# Postprocess partner (either update or create it depending on context options)
if len(partner) == 1 and match_update:
if partner and len(partner) == 1 and match_update:
self.update_partner(partner, vals)
if not partner and match_create:
partner = self._create_partner(vals)
Expand Down Expand Up @@ -107,7 +107,7 @@ def update_partner(self, partner, vals, async_mode=True, delay=1):
@api.model
def _preprocess_vals(self, vals):
"""Transform, if needed and before matching, the infos received"""
pass
vals["name"] = vals["name"].strip(' -')

@api.model
def _process_update_vals(self, partner, vals):
Expand Down Expand Up @@ -186,3 +186,4 @@ def _get_valid_update_fields(self):
"lang",
"title",
]

0 comments on commit 5dda2fe

Please sign in to comment.