diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py index 2c990c4133..3a04df0f50 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.py +++ b/erpnext/crm/doctype/opportunity/opportunity.py @@ -10,7 +10,7 @@ from frappe.email.inbox import link_communication_to_document from frappe.model.mapper import get_mapped_doc from frappe.utils import cint, cstr, flt, get_fullname -rom erpnext.crm.utils import add_link_in_communication, copy_comments +from erpnext.crm.utils import add_link_in_communication, copy_comments from erpnext.setup.utils import get_exchange_rate from erpnext.utilities.transaction_base import TransactionBase diff --git a/erpnext/crm/utils.py b/erpnext/crm/utils.py index 531d6c1594..8ae991ff17 100644 --- a/erpnext/crm/utils.py +++ b/erpnext/crm/utils.py @@ -39,7 +39,7 @@ def add_link_in_communication(doctype, docname, doc): "link_name": docname, "parent": ("not in", communications) }, pluck="parent") - + for communication in communications + communication_links: communication_doc = frappe.get_doc("Communication", communication) communication_doc.add_link(doc.doctype, doc.name, autosave=True) diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 979d5c6c96..2bb9b5582a 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -39,7 +39,7 @@ class Quotation(SellingController): if self.opportunity: copy_comments("Opportunity", self.opportunity, self) add_link_in_communication("Opportunity", self.opportunity, self) - + elif self.quotation_to == "Lead" and self.party_name: copy_comments("Lead", self.party_name, self) add_link_in_communication("Lead", self.party_name, self)