Joining date validation removed from Salary Structure

This commit is contained in:
Kanchan Chauhan
2017-02-06 10:48:43 +05:30
parent 6b9902627d
commit 5f5457085e
9 changed files with 131 additions and 116 deletions

View File

@@ -0,0 +1,9 @@
import frappe
def execute():
frappe.reload_doc('hr', 'doctype', 'salary_structure_employee')
salary_structures = frappe.db.sql("""select name, to_date, from_date from `tabSalary Structure`""", as_dict=True)
for salary_structure in salary_structures:
frappe.db.sql(""" update `tabSalary Structure Employee` set from_date = %s, to_date = %s
where parent = %s """, (salary_structure.from_date, salary_structure.to_date or 'null', salary_structure.name))