From c697526382d0740ff247e00d549608198088b490 Mon Sep 17 00:00:00 2001 From: tunde Date: Tue, 1 Aug 2017 17:00:14 +0100 Subject: [PATCH 1/4] except in python 3 compatible style --- erpnext/hr/doctype/process_payroll/process_payroll.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/process_payroll/process_payroll.py b/erpnext/hr/doctype/process_payroll/process_payroll.py index b58c7872ccf..287ce61b62a 100644 --- a/erpnext/hr/doctype/process_payroll/process_payroll.py +++ b/erpnext/hr/doctype/process_payroll/process_payroll.py @@ -311,7 +311,7 @@ class ProcessPayroll(Document): 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 From 85adbd7eaeadc8c90f5d417d0311308e1c5d657c Mon Sep 17 00:00:00 2001 From: tunde Date: Wed, 2 Aug 2017 14:17:46 +0100 Subject: [PATCH 2/4] show message if there's no submitted salary slip --- erpnext/hr/doctype/process_payroll/process_payroll.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/process_payroll/process_payroll.py b/erpnext/hr/doctype/process_payroll/process_payroll.py index 287ce61b62a..a2d5d3ed5f9 100644 --- a/erpnext/hr/doctype/process_payroll/process_payroll.py +++ b/erpnext/hr/doctype/process_payroll/process_payroll.py @@ -339,7 +339,12 @@ class ProcessPayroll(Document): "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" + ) def update_salary_slip_status(self, jv_name = None): ss_list = self.get_sal_slip_list(ss_status=1) From 919c9db1b0d6d94d8c02e2b11953b8e8215574ef Mon Sep 17 00:00:00 2001 From: tunde Date: Wed, 2 Aug 2017 15:19:24 +0100 Subject: [PATCH 3/4] indicator should be red --- erpnext/hr/doctype/process_payroll/process_payroll.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/process_payroll/process_payroll.py b/erpnext/hr/doctype/process_payroll/process_payroll.py index a2d5d3ed5f9..52c14c26bb0 100644 --- a/erpnext/hr/doctype/process_payroll/process_payroll.py +++ b/erpnext/hr/doctype/process_payroll/process_payroll.py @@ -343,7 +343,7 @@ class ProcessPayroll(Document): else: frappe.msgprint( "There are no submitted Salary Slips to process.", - title="Error" + title="Error", indicator="red" ) def update_salary_slip_status(self, jv_name = None): From 21045c456e7e9e7cb869a6855f9d2a70c7e0fc3a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 3 Aug 2017 10:20:10 +0530 Subject: [PATCH 4/4] Update process_payroll.py --- erpnext/hr/doctype/process_payroll/process_payroll.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/process_payroll/process_payroll.py b/erpnext/hr/doctype/process_payroll/process_payroll.py index 52c14c26bb0..7575ee45b46 100644 --- a/erpnext/hr/doctype/process_payroll/process_payroll.py +++ b/erpnext/hr/doctype/process_payroll/process_payroll.py @@ -342,7 +342,7 @@ class ProcessPayroll(Document): return journal_entry.as_dict() else: frappe.msgprint( - "There are no submitted Salary Slips to process.", + _("There are no submitted Salary Slips to process."), title="Error", indicator="red" )