Skip to content

Commit

Permalink
fix(lead): reload address and contact before updating their links
Browse files Browse the repository at this point in the history
They might have changed since they were created. Backport of frappe#29966.
  • Loading branch information
barredterra committed Feb 23, 2022
1 parent 37ba366 commit f83b096
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions erpnext/crm/doctype/lead/lead.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ def create_contact(self):
def update_links(self):
# update address links
if hasattr(self, 'address_doc'):
self.address_doc.reload()
self.address_doc.append("links", {
"link_doctype": "Lead",
"link_name": self.name,
Expand All @@ -204,6 +205,7 @@ def update_links(self):

# update contact links
if self.contact_doc:
self.contact_doc.reload()
self.contact_doc.append("links", {
"link_doctype": "Lead",
"link_name": self.name,
Expand Down

0 comments on commit f83b096

Please sign in to comment.