Fixed get_sender for Sales and Jobs
diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py
index 33f03b6..c6c2c14 100644
--- a/erpnext/controllers/selling_controller.py
+++ b/erpnext/controllers/selling_controller.py
@@ -16,10 +16,11 @@
check_active_sales_items(self)
def get_sender(self, comm):
- if frappe.db.get_value('Sales Email Settings', None, 'extract_emails'):
- return frappe.db.get_value('Sales Email Settings', None, 'email_id')
- else:
- return comm.sender or frappe.session.user
+ sender = None
+ if cint(frappe.db.get_value('Sales Email Settings', None, 'extract_emails')):
+ sender = frappe.db.get_value('Sales Email Settings', None, 'email_id')
+
+ return sender or comm.sender or frappe.session.user
def set_missing_values(self, for_validate=False):
super(SellingController, self).set_missing_values(for_validate)
diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.py b/erpnext/hr/doctype/job_applicant/job_applicant.py
index 3640304..1f09c26 100644
--- a/erpnext/hr/doctype/job_applicant/job_applicant.py
+++ b/erpnext/hr/doctype/job_applicant/job_applicant.py
@@ -9,9 +9,9 @@
from frappe.utils import extract_email_id
class JobApplicant(TransactionBase):
-
+
def get_sender(self, comm):
- return frappe.db.get_value('Jobs Email Settings',None,'email_id')
-
+ return frappe.db.get_value('Jobs Email Settings',None,'email_id') or comm.sender or frappe.session.user
+
def validate(self):
- self.set_status()
\ No newline at end of file
+ self.set_status()