Update set_salary_details_submitable.py
This commit is contained in:
parent
35e52b5596
commit
36561801c2
@ -1,12 +1,11 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
import itertools
|
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
salary_structure = frappe.get_all("Salary Structure", filters={"docstatus": 1}, as_list=1)
|
frappe.db.sql("""
|
||||||
salary_structure = list(itertools.chain(*salary_structure))
|
update `tabSalary Structure` ss, `tabSalary Detail` sd
|
||||||
salary_structure = "', '".join(map(str, salary_structure))
|
set sd.docstatus=1
|
||||||
|
where ss.name=sd.parent and ss.docstatus=1 and sd.parenttype='Salary Structure'
|
||||||
|
""")
|
||||||
|
|
||||||
query = ''' update `tabSalary Detail` set docstatus=1 where parent in ('{0}')'''.format(salary_structure)
|
|
||||||
frappe.db.sql(query)
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user