fix(Payroll): Cannot submit salary slips from amended payroll entry. (backport #29228) (#29268)

* fix: salary slip transaction state after payroll entry cancel

* fix: use db_set in on_cancel method

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
(cherry picked from commit 81f1b7dfeb68c5a70f4aa9bc0e24f7aedcd79669)

Co-authored-by: Devin Slauenwhite <devin.slauenwhite@gmail.com>
This commit is contained in:
mergify[bot] 2022-01-13 11:09:36 +05:30 committed by GitHub
parent eb8d08b411
commit 82b2d22627
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,6 +61,8 @@ class PayrollEntry(Document):
def on_cancel(self):
frappe.delete_doc("Salary Slip", frappe.db.sql_list("""select name from `tabSalary Slip`
where payroll_entry=%s """, (self.name)))
self.db_set("salary_slips_created", 0)
self.db_set("salary_slips_submitted", 0)
def get_emp_list(self):
"""