fix: Fixes related to client script renaming (#24698)
This commit is contained in:
parent
98a0feab89
commit
0ca74ce04b
@ -20,7 +20,7 @@ doctype_series_map = {
|
||||
'Certified Consultant': 'NPO-CONS-.YYYY.-.#####',
|
||||
'Chat Room': 'CHAT-ROOM-.#####',
|
||||
'Compensatory Leave Request': 'HR-CMP-.YY.-.MM.-.#####',
|
||||
'Custom Script': 'SYS-SCR-.#####',
|
||||
'Client Script': 'SYS-SCR-.#####',
|
||||
'Employee Benefit Application': 'HR-BEN-APP-.YY.-.MM.-.#####',
|
||||
'Employee Benefit Application Detail': '',
|
||||
'Employee Benefit Claim': 'HR-BEN-CLM-.YY.-.MM.-.#####',
|
||||
|
@ -9,7 +9,7 @@ def execute():
|
||||
# NOTE: sequence is important
|
||||
renamed_fields = get_all_renamed_fields()
|
||||
|
||||
for dt, script_field, ref_dt_field in (("Custom Script", "script", "dt"), ("Print Format", "html", "doc_type")):
|
||||
for dt, script_field, ref_dt_field in (("Client Script", "script", "dt"), ("Print Format", "html", "doc_type")):
|
||||
|
||||
cond1 = " or ".join("""{0} like "%%{1}%%" """.format(script_field, d[0].replace("_", "\\_")) for d in renamed_fields)
|
||||
cond2 = " and standard = 'No'" if dt == "Print Format" else ""
|
||||
|
@ -7,7 +7,7 @@ def execute():
|
||||
where name in('Time Log Batch', 'Time Log Batch Detail', 'Time Log')""")
|
||||
|
||||
frappe.db.sql("""delete from `tabDocField` where parent in ('Time Log', 'Time Log Batch')""")
|
||||
frappe.db.sql("""update `tabCustom Script` set dt = 'Timesheet' where dt = 'Time Log'""")
|
||||
frappe.db.sql("""update `tabClient Script` set dt = 'Timesheet' where dt = 'Time Log'""")
|
||||
|
||||
for data in frappe.db.sql(""" select label, fieldname from `tabCustom Field` where dt = 'Time Log'""", as_dict=1):
|
||||
custom_field = frappe.get_doc({
|
||||
|
Loading…
x
Reference in New Issue
Block a user