Add communication entry to Sales Order only if payment entry email is sent to customer (#10716)

This commit is contained in:
Neil Trini Lasrado 2017-09-18 16:41:49 +05:30 committed by Rushabh Mehta
parent 9b4f3cf9de
commit 8c9f2a1be6

View File

@ -35,7 +35,6 @@ class PaymentRequest(Document):
def on_submit(self):
send_mail = True
self.make_communication_entry()
ref_doc = frappe.get_doc(self.reference_doctype, self.reference_name)
if (hasattr(ref_doc, "order_type") and getattr(ref_doc, "order_type") == "Shopping Cart") \
@ -45,6 +44,7 @@ class PaymentRequest(Document):
if send_mail:
self.set_payment_request_url()
self.send_email()
self.make_communication_entry()
def on_cancel(self):
self.check_if_payment_entry_exists()