Skip to content

Commit

Permalink
changed cms.form.partner to handle case when partner_id is known
Browse files Browse the repository at this point in the history
  • Loading branch information
Prazn authored and ecino committed Sep 23, 2024
1 parent ac4a514 commit 3020b48
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions partner_auto_match/models/abstract_partner_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ def create(self, vals_list):
match_update = vals.get("match_update", False)
match_create = vals.get("match_create", True)
if vals.get("partner_id") and match_update:
partner = self.env["res.partner"].browse(vals["partner_id"])
self.env["res.partner.match"].update_partner(partner, vals)
partner_vals = self._convert_vals_for_res_partner(vals)
partner = self.env["res.partner"].browse(partner_vals["id"])
self.env["res.partner.match"].update_partner(partner, partner_vals)
if not vals.get("partner_id") and (match_update or match_create):
partner_vals = self._convert_vals_for_res_partner(vals)
vals["partner_id"] = (
Expand Down

0 comments on commit 3020b48

Please sign in to comment.