Skip to content

Commit

Permalink
T1767 - Funds partner matching (#1955)
Browse files Browse the repository at this point in the history
* feat: ignore spaces and dashes around name when matching partner

* chore: format

* fix: check for name when preprocessing

Co-authored-by: ecino <ecino@users.noreply.github.com>

---------

Co-authored-by: Clément <clement.charmillot@gmail.com>
Co-authored-by: ecino <ecino@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 2, 2024
1 parent b97b08a commit 7525bd8
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,8 @@ 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
if "name" in vals:
vals["name"] = vals["name"].strip(" -")

@api.model
def _process_update_vals(self, partner, vals):
Expand Down

0 comments on commit 7525bd8

Please sign in to comment.