系统Doctype的字段添加新的选项
实现效果:
代码:
apps/erpnextxx/erpnextxx/fixtures/social_login_options.json
[
{
"doc_type": "Social Login Key",
"doctype": "Property Setter",
"docstatus": 0,
"doctype_or_field": "DocField",
"field_name": "social_login_provider",
"is_system_generated": 0,
"modified": "2023-10-09 21:13:35.436900",
"module": null,
"name": "Social-Login-Key-options",
"property": "options",
"property_type": "Text",
"value": "Custom\nFacebook\nFrappe\nGitHub\nGoogle\nOffice 365\nSalesforce\nfairlogin\nWeCom"
}
]
hooks.py 配置:
fixtures = [
{
"dt": "DocField",
"filters": [
["fieldname", "=", "social_login_provider"],
["parent", "=", "Social Login Key"],
["parenttype", "=", "DocType"],
],
}
]