fix(ux): inform the user about salary slip creation/submission happening in the background

This commit is contained in:
Rucha Mahabal 2022-03-16 10:31:34 +05:30
parent 9fb7b49b43
commit 81c82c8d53

View File

@ -174,9 +174,11 @@ class PayrollEntry(Document):
}
)
if len(employees) > 30:
frappe.enqueue(create_salary_slips_for_employees, timeout=600, employees=employees, args=args)
frappe.enqueue(create_salary_slips_for_employees, timeout=600, employees=employees, args=args, publish_progress=False)
frappe.msgprint(_("Salary Slip creation has been queued. It may take a few minutes."),
alert=True, indicator="orange")
else:
create_salary_slips_for_employees(employees, args, publish_progress=False)
create_salary_slips_for_employees(employees, args, publish_progress=True)
# since this method is called via frm.call this doc needs to be updated manually
self.reload()
@ -209,6 +211,8 @@ class PayrollEntry(Document):
frappe.enqueue(
submit_salary_slips_for_employees, timeout=600, payroll_entry=self, salary_slips=ss_list
)
frappe.msgprint(_("Salary Slip submission has been queued. It may take a few minutes."),
alert=True, indicator="orange")
else:
submit_salary_slips_for_employees(self, ss_list, publish_progress=False)