Skip to content

Commit

Permalink
fix: only upsert if partner has global_id yet (#1946)
Browse files Browse the repository at this point in the history
Co-authored-by: Clément <clement.charmillot@gmail.com>
  • Loading branch information
clementcharmillot and Clément authored Aug 15, 2024
1 parent ac37269 commit e772a0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sponsorship_compassion/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ def write(self, vals):
notify = functools.reduce(
lambda prev, val: prev or val in vals, notify_vals, False
)
if notify and not self.env.context.get("no_upsert"):

if notify and self.global_id and not self.env.context.get("no_upsert"):
self.upsert_constituent()

self._updt_invoices_rp(vals)
Expand Down

0 comments on commit e772a0a

Please sign in to comment.