def update_property_setters_and_custom_fields(new_dt, dt_cols): for doctype, cols in dt_cols.items(): frappe.db.sql("update `tabProperty Setter` set doc_type = %s where doc_type=%s", (new_dt, doctype)) frappe.db.sql("update `tabCustom Field` set dt = %s where dt=%s", (new_dt, doctype)) for old_fieldname, new_fieldname in cols.items(): update_property_setters(new_dt, old_fieldname, new_fieldname)
def update_property_setters_and_custom_fields(new_dt, dt_cols): for doctype, cols in dt_cols.items(): frappe.db.sql( "update `tabProperty Setter` set doc_type = %s where doc_type=%s", (new_dt, doctype)) frappe.db.sql("update `tabCustom Field` set dt = %s where dt=%s", (new_dt, doctype)) for old_fieldname, new_fieldname in cols.items(): update_property_setters(new_dt, old_fieldname, new_fieldname)
def execute(): if "att_date" not in frappe.db.get_table_columns("Attendance"): return frappe.reload_doc("hr", "doctype", "attendance") frappe.db.sql("""update `tabAttendance` set attendance_date = att_date where attendance_date is null or attendance_date = '' or attendance_date = '0000-00-00'""") update_reports("Attendance", "att_date", "attendance_date") update_users_report_view_settings("Attendance", "att_date", "attendance_date") update_property_setters("Attendance", "att_date", "attendance_date")
def execute(): if "att_date" not in frappe.db.get_table_columns("Attendance"): return frappe.reload_doc("hr", "doctype", "attendance") frappe.db.sql("""update `tabAttendance` set attendance_date = att_date where attendance_date is null or attendance_date = '0000-00-00'""") update_reports("Attendance", "att_date", "attendance_date") update_users_report_view_settings("Attendance", "att_date", "attendance_date") update_property_setters("Attendance", "att_date", "attendance_date")
def update_prop_setters_reports_print_format_for_po(): for key, val in get_columns().items(): update_property_setters('Purchase Order Item', key, val) update_reports('Purchase Order Item', key, val) update_print_format_for_po(key, val, 'Purchase Order')