seitime-frappe/frappe/utils/testutils.py
Gavin D'souza 3446026555 chore: Update header: license.txt => LICENSE
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
2021-09-03 12:02:59 +05:30

16 lines
459 B
Python

# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe
def add_custom_field(doctype, fieldname, fieldtype='Data', options=None):
frappe.get_doc({
"doctype": "Custom Field",
"dt": doctype,
"fieldname": fieldname,
"fieldtype": fieldtype,
"options": options
}).insert()
def clear_custom_fields(doctype):
frappe.db.delete("Custom Field", {"dt": doctype})
frappe.clear_cache(doctype=doctype)