Skip to content

Commit

Permalink
fix(test): create missing timesheet salary component
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchamahabal committed Dec 14, 2021
1 parent 9bbe16c commit b8c42aa
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions erpnext/projects/doctype/timesheet/test_timesheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ def setUp(self):
for dt in ["Salary Slip", "Salary Structure", "Salary Structure Assignment", "Timesheet"]:
frappe.db.sql("delete from `tab%s`" % dt)

if not frappe.db.exists("Salary Component", "Timesheet Component"):
frappe.get_doc({"doctype": "Salary Component", "salary_component": "Timesheet Component"}).insert()


def test_timesheet_billing_amount(self):
emp = make_employee("test_employee_6@salary.com")

Expand Down Expand Up @@ -160,6 +156,9 @@ def make_salary_structure_for_timesheet(employee, company=None):
salary_structure_name = "Timesheet Salary Structure Test"
frequency = "Monthly"

if not frappe.db.exists("Salary Component", "Timesheet Component"):
frappe.get_doc({"doctype": "Salary Component", "salary_component": "Timesheet Component"}).insert()

salary_structure = make_salary_structure(salary_structure_name, frequency, company=company, dont_submit=True)
salary_structure.salary_component = "Timesheet Component"
salary_structure.salary_slip_based_on_timesheet = 1
Expand Down

0 comments on commit b8c42aa

Please sign in to comment.