Merge pull request #14468 from manassolanki/fix-travis-1
fix the salary slip test cases
This commit is contained in:
commit
d7f6d45e28
@ -447,7 +447,7 @@ class SalarySlip(TransactionBase):
|
|||||||
else:
|
else:
|
||||||
self.set_status()
|
self.set_status()
|
||||||
self.update_status(self.name)
|
self.update_status(self.name)
|
||||||
if(frappe.db.get_single_value("HR Settings", "email_salary_slip_to_employee")) and not frappe.flags.via_payroll_entry:
|
if (frappe.db.get_single_value("HR Settings", "email_salary_slip_to_employee")) and not frappe.flags.via_payroll_entry:
|
||||||
self.email_salary_slip()
|
self.email_salary_slip()
|
||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
@ -466,7 +466,10 @@ class SalarySlip(TransactionBase):
|
|||||||
"reference_doctype": self.doctype,
|
"reference_doctype": self.doctype,
|
||||||
"reference_name": self.name
|
"reference_name": self.name
|
||||||
}
|
}
|
||||||
enqueue(method=frappe.sendmail, queue='short', timeout=300, async=True, **email_args)
|
if not frappe.flags.in_test:
|
||||||
|
enqueue(method=frappe.sendmail, queue='short', timeout=300, async=True, **email_args)
|
||||||
|
else:
|
||||||
|
frappe.sendmail(**email_args)
|
||||||
else:
|
else:
|
||||||
msgprint(_("{0}: Employee email not found, hence email not sent").format(self.employee_name))
|
msgprint(_("{0}: Employee email not found, hence email not sent").format(self.employee_name))
|
||||||
|
|
||||||
|
|||||||
@ -279,7 +279,7 @@ def make_salary_structure(sal_struct, payroll_frequency, employee):
|
|||||||
"payroll_frequency": payroll_frequency,
|
"payroll_frequency": payroll_frequency,
|
||||||
"payment_account": get_random("Account")
|
"payment_account": get_random("Account")
|
||||||
}).insert()
|
}).insert()
|
||||||
create_salary_structure_assignment(employee, salary_structure)
|
create_salary_structure_assignment(employee, salary_structure.name)
|
||||||
|
|
||||||
elif not frappe.db.get_value("Salary Structure Assignment",{'salary_structure':sal_struct, 'employee':employee},'name'):
|
elif not frappe.db.get_value("Salary Structure Assignment",{'salary_structure':sal_struct, 'employee':employee},'name'):
|
||||||
create_salary_structure_assignment(employee, sal_struct)
|
create_salary_structure_assignment(employee, sal_struct)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user