diff --git a/erpnext/patches.txt b/erpnext/patches.txt index e64aa378e2e..2df10899800 100755 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -590,4 +590,5 @@ erpnext.patches.v10_0.item_barcode_childtable_migrate # 16-02-2019 erpnext.patches.v11_0.make_italian_localization_fields # 26-03-2019 erpnext.patches.v11_1.make_job_card_time_logs erpnext.patches.v11_1.set_variant_based_on -erpnext.patches.v11_1.woocommerce_set_creation_user \ No newline at end of file +erpnext.patches.v11_1.woocommerce_set_creation_user +erpnext.patches.v11_1.set_salary_details_submitable \ No newline at end of file diff --git a/erpnext/patches/v11_1/set_salary_details_submitable.py b/erpnext/patches/v11_1/set_salary_details_submitable.py new file mode 100644 index 00000000000..36e78792ecb --- /dev/null +++ b/erpnext/patches/v11_1/set_salary_details_submitable.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +import frappe +import itertools + +def execute(): + salary_structure = frappe.get_all("Salary Structure", filters={"docstatus": 1}, as_list=1) + salary_structure = list(itertools.chain(*salary_structure)) + salary_structure = "', '".join(map(str, salary_structure)) + + query = ''' update `tabSalary Detail` set docstatus=1 where parent in ('{0}')'''.format(salary_structure) + frappe.db.sql(query) +