Merge pull request #10255 from tundebabzy/issue-10215
Error when creating Bank Entry from Process Payroll (#10215)
diff --git a/erpnext/hr/doctype/process_payroll/process_payroll.py b/erpnext/hr/doctype/process_payroll/process_payroll.py
index b58c787..7575ee4 100644
--- a/erpnext/hr/doctype/process_payroll/process_payroll.py
+++ b/erpnext/hr/doctype/process_payroll/process_payroll.py
@@ -311,7 +311,7 @@
journal_entry.submit()
jv_name = journal_entry.name
self.update_salary_slip_status(jv_name = jv_name)
- except Exception, e:
+ except Exception as e:
frappe.msgprint(e)
return jv_name
@@ -339,7 +339,12 @@
"debit_in_account_currency": total_salary_amount.rounded_total
})
journal_entry.set("accounts", account_amt_list)
- return journal_entry.as_dict()
+ return journal_entry.as_dict()
+ else:
+ frappe.msgprint(
+ _("There are no submitted Salary Slips to process."),
+ title="Error", indicator="red"
+ )
def update_salary_slip_status(self, jv_name = None):
ss_list = self.get_sal_slip_list(ss_status=1)