chore: migrate Address/Contact custom fields from JSON fixtures to install (backport #55084) (#55088)

Co-authored-by: diptanilsaha <diptanil@frappe.io>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
fixtures to install (#55084)
This commit is contained in:
mergify[bot]
2026-05-20 21:24:40 +05:30
committed by GitHub
parent cc438a4600
commit 6d8bbc5b6f
5 changed files with 49 additions and 186 deletions

View File

@@ -25,6 +25,7 @@ def after_install():
setup_repost_defaults()
create_print_setting_custom_fields()
create_marketing_campaign_custom_fields()
create_address_and_contact_custom_fields()
create_custom_company_links()
add_all_roles_to("Administrator")
create_default_success_action()
@@ -145,6 +146,37 @@ def create_marketing_campaign_custom_fields():
)
def create_address_and_contact_custom_fields():
create_custom_fields(
{
"Address": [
{
"label": _("Tax Category"),
"fieldname": "tax_category",
"fieldtype": "Link",
"options": "Tax Category",
"insert_after": "fax",
},
{
"label": _("Is Your Company Address"),
"fieldname": "is_your_company_address",
"fieldtype": "Check",
"default": "0",
"insert_after": "linked_with",
},
],
"Contact": [
{
"label": _("Is Billing Contact"),
"fieldname": "is_billing_contact",
"fieldtype": "Check",
"insert_after": "is_primary_contact",
},
],
}
)
def create_default_success_action():
for success_action in get_default_success_action():
if not frappe.db.exists("Success Action", success_action.get("ref_doctype")):