Rushabh Mehta | 81e9d4e | 2015-08-19 13:00:03 +0530 | [diff] [blame] | 1 | ## temp utility |
| 2 | |
| 3 | import frappe |
| 4 | |
| 5 | def update_doctypes(): |
| 6 | for d in frappe.db.sql("""select df.parent, df.fieldname |
| 7 | from tabDocField df, tabDocType dt where df.fieldname |
| 8 | like "%description%" and df.parent = dt.name and dt.istable = 1""", as_dict=1): |
| 9 | dt = frappe.get_doc("DocType", d.parent) |
| 10 | |
| 11 | for f in dt.fields: |
| 12 | if f.fieldname == d.fieldname and f.fieldtype in ("Text", "Small Text"): |
| 13 | print f.parent, f.fieldname |
| 14 | f.fieldtype = "Text Editor" |
| 15 | dt.save() |
| 16 | break |