update fixtures, doctypes, and migration data
This commit is contained in:
parent
6ff5a09ad4
commit
d691f5b9db
@ -153,8 +153,8 @@ def import_aspire_migration(site, path, dry_run):
|
||||
|
||||
def fast_insert(rec, label="record"):
|
||||
"""Insert a doc skipping hooks, validations, and permissions."""
|
||||
doc = frappe.get_doc(rec)
|
||||
company_links = rec.pop("companies", [])
|
||||
doc = frappe.get_doc(rec)
|
||||
doc.flags.ignore_permissions = True
|
||||
doc.flags.ignore_mandatory = True
|
||||
doc.flags.ignore_links = True
|
||||
@ -187,8 +187,72 @@ def import_aspire_migration(site, path, dry_run):
|
||||
doc.flags.ignore_permissions = True
|
||||
doc.save()
|
||||
|
||||
# --- Step 1: Insert Customers ---
|
||||
click.echo("📦 Step 1: Inserting Customers...")
|
||||
# --- Step 1: Insert Contacts ---
|
||||
click.echo("📦 Step 1: Inserting Contacts...")
|
||||
t0 = time.time()
|
||||
with open(contacts_file) as f:
|
||||
contacts = json.load(f)
|
||||
|
||||
success, skipped, failed = 0, 0, 0
|
||||
total = len(contacts)
|
||||
for i, rec in enumerate(contacts):
|
||||
full_name = f"{rec.get('first_name', '')} {rec.get('last_name', '')}".strip()
|
||||
if frappe.db.exists("Contact", {"full_name": full_name}):
|
||||
skipped += 1
|
||||
continue
|
||||
if dry_run:
|
||||
click.echo(f" [DRY RUN] Would insert Contact: {rec.get('first_name')} {rec.get('last_name')}")
|
||||
continue
|
||||
try:
|
||||
fast_insert(rec, "Contact")
|
||||
success += 1
|
||||
except Exception as e:
|
||||
failed += 1
|
||||
print("Error inserting Contact {}: {}".format(full_name, e))
|
||||
|
||||
print_progress("Contacts", i + 1, total, success, skipped, failed)
|
||||
|
||||
if (i + 1) % BATCH_SIZE == 0:
|
||||
frappe.db.commit()
|
||||
|
||||
frappe.db.commit()
|
||||
finish_progress("Contacts", success, skipped, failed, time.time() - t0)
|
||||
|
||||
# Clear cache so link validation can find the newly inserted contacts
|
||||
frappe.clear_cache()
|
||||
|
||||
# --- Step 2: Insert Addresses ---
|
||||
click.echo("📦 Step 2: Inserting Addresses...")
|
||||
t0 = time.time()
|
||||
with open(addresses_file) as f:
|
||||
addresses = json.load(f)
|
||||
|
||||
success, skipped, failed = 0, 0, 0
|
||||
total = len(addresses)
|
||||
for i, rec in enumerate(addresses):
|
||||
if frappe.db.exists("Address", {"address_title": rec.get("address_title")}):
|
||||
skipped += 1
|
||||
continue
|
||||
if dry_run:
|
||||
click.echo(f" [DRY RUN] Would insert Address: {rec.get('address_line1')}")
|
||||
continue
|
||||
try:
|
||||
fast_insert(rec, "Address")
|
||||
success += 1
|
||||
except Exception as e:
|
||||
print(f"Error inserting Address {rec.get('address_title')}: {e}")
|
||||
failed += 1
|
||||
|
||||
print_progress("Addresses", i + 1, total, success, skipped, failed)
|
||||
|
||||
if (i + 1) % BATCH_SIZE == 0:
|
||||
frappe.db.commit()
|
||||
|
||||
frappe.db.commit()
|
||||
finish_progress("Addresses", success, skipped, failed, time.time() - t0)
|
||||
|
||||
# --- Step 3: Insert Customers ---
|
||||
click.echo("📦 Step 3: Inserting Customers...")
|
||||
t0 = time.time()
|
||||
with open(customers_file) as f:
|
||||
customers = json.load(f)
|
||||
@ -220,69 +284,6 @@ def import_aspire_migration(site, path, dry_run):
|
||||
frappe.db.commit()
|
||||
finish_progress("Customers", success, skipped, failed, time.time() - t0)
|
||||
|
||||
# --- Step 2: Insert Contacts ---
|
||||
click.echo("📦 Step 2: Inserting Contacts...")
|
||||
t0 = time.time()
|
||||
with open(contacts_file) as f:
|
||||
contacts = json.load(f)
|
||||
|
||||
success, skipped, failed = 0, 0, 0
|
||||
total = len(contacts)
|
||||
for i, rec in enumerate(contacts):
|
||||
full_name = f"{rec.get('first_name', '')} {rec.get('last_name', '')}".strip()
|
||||
if frappe.db.exists("Contact", {"full_name": full_name}):
|
||||
skipped += 1
|
||||
continue
|
||||
if dry_run:
|
||||
click.echo(f" [DRY RUN] Would insert Contact: {rec.get('first_name')} {rec.get('last_name')}")
|
||||
continue
|
||||
try:
|
||||
fast_insert(rec, "Contact")
|
||||
success += 1
|
||||
except Exception as e:
|
||||
failed += 1
|
||||
|
||||
print_progress("Contacts", i + 1, total, success, skipped, failed)
|
||||
|
||||
if (i + 1) % BATCH_SIZE == 0:
|
||||
frappe.db.commit()
|
||||
|
||||
frappe.db.commit()
|
||||
finish_progress("Contacts", success, skipped, failed, time.time() - t0)
|
||||
|
||||
# Clear cache so link validation can find the newly inserted contacts
|
||||
frappe.clear_cache()
|
||||
|
||||
# --- Step 3: Insert Addresses ---
|
||||
click.echo("📦 Step 3: Inserting Addresses...")
|
||||
t0 = time.time()
|
||||
with open(addresses_file) as f:
|
||||
addresses = json.load(f)
|
||||
|
||||
success, skipped, failed = 0, 0, 0
|
||||
total = len(addresses)
|
||||
for i, rec in enumerate(addresses):
|
||||
if frappe.db.exists("Address", {"address_title": rec.get("address_title")}):
|
||||
skipped += 1
|
||||
continue
|
||||
if dry_run:
|
||||
click.echo(f" [DRY RUN] Would insert Address: {rec.get('address_line1')}")
|
||||
continue
|
||||
try:
|
||||
fast_insert(rec, "Address")
|
||||
success += 1
|
||||
except Exception as e:
|
||||
print(f"Error inserting Address {rec.get('address_title')}: {e}")
|
||||
failed += 1
|
||||
|
||||
print_progress("Addresses", i + 1, total, success, skipped, failed)
|
||||
|
||||
if (i + 1) % BATCH_SIZE == 0:
|
||||
frappe.db.commit()
|
||||
|
||||
frappe.db.commit()
|
||||
finish_progress("Addresses", success, skipped, failed, time.time() - t0)
|
||||
|
||||
# --- Step 4: Update Customers with child tables ---
|
||||
click.echo("📦 Step 4: Updating Customers with contact/property links...")
|
||||
t0 = time.time()
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
"actions": [],
|
||||
"allow_rename": 1,
|
||||
"autoname": "format:{address}-{#####}",
|
||||
"creation": "2026-01-30 05:04:20.781088",
|
||||
"creation": "2026-02-18 05:53:08.499214",
|
||||
"custom": 1,
|
||||
"doctype": "DocType",
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
@ -41,8 +42,8 @@
|
||||
"grid_page_length": 50,
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2026-01-30 07:03:40.962554",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2026-02-21 16:24:20.259158",
|
||||
"modified_by": "casey@shilohcode.com",
|
||||
"module": "Custom UI",
|
||||
"name": "On-Site Meeting",
|
||||
"naming_rule": "Expression",
|
||||
|
||||
@ -5748,7 +5748,7 @@
|
||||
"read_only": 0,
|
||||
"read_only_depends_on": null,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"show_dashboard": 0,
|
||||
"sort_options": 0,
|
||||
@ -6204,7 +6204,7 @@
|
||||
"read_only": 0,
|
||||
"read_only_depends_on": null,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"show_dashboard": 0,
|
||||
"sort_options": 0,
|
||||
@ -6432,7 +6432,7 @@
|
||||
"read_only": 0,
|
||||
"read_only_depends_on": null,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"show_dashboard": 0,
|
||||
"sort_options": 0,
|
||||
@ -6603,7 +6603,7 @@
|
||||
"read_only": 0,
|
||||
"read_only_depends_on": null,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"show_dashboard": 0,
|
||||
"sort_options": 0,
|
||||
@ -6855,7 +6855,7 @@
|
||||
"fetch_from": null,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "customer_type",
|
||||
"fieldtype": "Select",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"hide_border": 0,
|
||||
"hide_days": 0,
|
||||
@ -6878,7 +6878,7 @@
|
||||
"name": "Quotation-customer_type",
|
||||
"no_copy": 0,
|
||||
"non_negative": 0,
|
||||
"options": "Customer\nLead",
|
||||
"options": "DocType",
|
||||
"permlevel": 0,
|
||||
"placeholder": null,
|
||||
"precision": "",
|
||||
@ -6953,63 +6953,6 @@
|
||||
"unique": 0,
|
||||
"width": null
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"collapsible_depends_on": null,
|
||||
"columns": 0,
|
||||
"default": null,
|
||||
"depends_on": null,
|
||||
"description": null,
|
||||
"docstatus": 0,
|
||||
"doctype": "Custom Field",
|
||||
"dt": "Address",
|
||||
"fetch_from": null,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "tax_category",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"hide_border": 0,
|
||||
"hide_days": 0,
|
||||
"hide_seconds": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "fax",
|
||||
"is_system_generated": 0,
|
||||
"is_virtual": 0,
|
||||
"label": "Tax Category",
|
||||
"length": 0,
|
||||
"link_filters": null,
|
||||
"mandatory_depends_on": null,
|
||||
"modified": "2018-12-28 22:29:21.828090",
|
||||
"module": null,
|
||||
"name": "Address-tax_category",
|
||||
"no_copy": 0,
|
||||
"non_negative": 0,
|
||||
"options": "Tax Category",
|
||||
"permlevel": 0,
|
||||
"placeholder": null,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"print_width": null,
|
||||
"read_only": 0,
|
||||
"read_only_depends_on": null,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"show_dashboard": 0,
|
||||
"sort_options": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0,
|
||||
"width": null
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
@ -7580,6 +7523,63 @@
|
||||
"unique": 0,
|
||||
"width": null
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"collapsible_depends_on": null,
|
||||
"columns": 0,
|
||||
"default": null,
|
||||
"depends_on": null,
|
||||
"description": null,
|
||||
"docstatus": 0,
|
||||
"doctype": "Custom Field",
|
||||
"dt": "Contact",
|
||||
"fetch_from": null,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "is_billing_contact",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"hide_border": 0,
|
||||
"hide_days": 0,
|
||||
"hide_seconds": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "is_primary_contact",
|
||||
"is_system_generated": 0,
|
||||
"is_virtual": 0,
|
||||
"label": "Is Billing Contact",
|
||||
"length": 0,
|
||||
"link_filters": null,
|
||||
"mandatory_depends_on": null,
|
||||
"modified": "2019-12-02 11:00:03.432994",
|
||||
"module": null,
|
||||
"name": "Contact-is_billing_contact",
|
||||
"no_copy": 0,
|
||||
"non_negative": 0,
|
||||
"options": null,
|
||||
"permlevel": 0,
|
||||
"placeholder": null,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"print_width": null,
|
||||
"read_only": 0,
|
||||
"read_only_depends_on": null,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"show_dashboard": 0,
|
||||
"sort_options": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0,
|
||||
"width": null
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
@ -8207,63 +8207,6 @@
|
||||
"unique": 0,
|
||||
"width": null
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"collapsible_depends_on": null,
|
||||
"columns": 0,
|
||||
"default": "0",
|
||||
"depends_on": null,
|
||||
"description": null,
|
||||
"docstatus": 0,
|
||||
"doctype": "Custom Field",
|
||||
"dt": "Address",
|
||||
"fetch_from": null,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "is_your_company_address",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"hide_border": 0,
|
||||
"hide_days": 0,
|
||||
"hide_seconds": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "linked_with",
|
||||
"is_system_generated": 0,
|
||||
"is_virtual": 0,
|
||||
"label": "Is Your Company Address",
|
||||
"length": 0,
|
||||
"link_filters": null,
|
||||
"mandatory_depends_on": null,
|
||||
"modified": "2020-10-14 17:41:40.878179",
|
||||
"module": null,
|
||||
"name": "Address-is_your_company_address",
|
||||
"no_copy": 0,
|
||||
"non_negative": 0,
|
||||
"options": null,
|
||||
"permlevel": 0,
|
||||
"placeholder": null,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"print_width": null,
|
||||
"read_only": 0,
|
||||
"read_only_depends_on": null,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"show_dashboard": 0,
|
||||
"sort_options": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0,
|
||||
"width": null
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
@ -8435,6 +8378,63 @@
|
||||
"unique": 0,
|
||||
"width": null
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"collapsible_depends_on": null,
|
||||
"columns": 0,
|
||||
"default": "0",
|
||||
"depends_on": null,
|
||||
"description": null,
|
||||
"docstatus": 0,
|
||||
"doctype": "Custom Field",
|
||||
"dt": "Address",
|
||||
"fetch_from": null,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "is_your_company_address",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 1,
|
||||
"hide_border": 0,
|
||||
"hide_days": 0,
|
||||
"hide_seconds": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "custom_subdivision",
|
||||
"is_system_generated": 0,
|
||||
"is_virtual": 0,
|
||||
"label": "Is Your Company Address",
|
||||
"length": 0,
|
||||
"link_filters": null,
|
||||
"mandatory_depends_on": null,
|
||||
"modified": "2020-10-14 17:41:40.878179",
|
||||
"module": null,
|
||||
"name": "Address-is_your_company_address",
|
||||
"no_copy": 0,
|
||||
"non_negative": 0,
|
||||
"options": null,
|
||||
"permlevel": 0,
|
||||
"placeholder": null,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"print_width": null,
|
||||
"read_only": 0,
|
||||
"read_only_depends_on": null,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"show_dashboard": 0,
|
||||
"sort_options": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0,
|
||||
"width": null
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
@ -9290,63 +9290,6 @@
|
||||
"unique": 0,
|
||||
"width": null
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"collapsible_depends_on": null,
|
||||
"columns": 0,
|
||||
"default": null,
|
||||
"depends_on": null,
|
||||
"description": null,
|
||||
"docstatus": 0,
|
||||
"doctype": "Custom Field",
|
||||
"dt": "Contact",
|
||||
"fetch_from": null,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "is_billing_contact",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"hide_border": 0,
|
||||
"hide_days": 0,
|
||||
"hide_seconds": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "is_primary_contact",
|
||||
"is_system_generated": 0,
|
||||
"is_virtual": 0,
|
||||
"label": "Is Billing Contact",
|
||||
"length": 0,
|
||||
"link_filters": null,
|
||||
"mandatory_depends_on": null,
|
||||
"modified": "2019-12-02 11:00:03.432994",
|
||||
"module": null,
|
||||
"name": "Contact-is_billing_contact",
|
||||
"no_copy": 0,
|
||||
"non_negative": 0,
|
||||
"options": null,
|
||||
"permlevel": 0,
|
||||
"placeholder": null,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"print_width": null,
|
||||
"read_only": 0,
|
||||
"read_only_depends_on": null,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"show_dashboard": 0,
|
||||
"sort_options": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0,
|
||||
"width": null
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
@ -11301,7 +11244,7 @@
|
||||
"fetch_from": null,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "customer_type",
|
||||
"fieldtype": "Select",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"hide_border": 0,
|
||||
"hide_days": 0,
|
||||
@ -11324,7 +11267,7 @@
|
||||
"name": "Address-customer_type",
|
||||
"no_copy": 0,
|
||||
"non_negative": 0,
|
||||
"options": "Customer\nLead",
|
||||
"options": "DocType",
|
||||
"permlevel": 0,
|
||||
"placeholder": null,
|
||||
"precision": "",
|
||||
@ -12311,6 +12254,63 @@
|
||||
"unique": 0,
|
||||
"width": null
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"collapsible_depends_on": null,
|
||||
"columns": 0,
|
||||
"default": null,
|
||||
"depends_on": null,
|
||||
"description": null,
|
||||
"docstatus": 0,
|
||||
"doctype": "Custom Field",
|
||||
"dt": "Address",
|
||||
"fetch_from": null,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "tax_category",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"hide_border": 0,
|
||||
"hide_days": 0,
|
||||
"hide_seconds": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "fax",
|
||||
"is_system_generated": 0,
|
||||
"is_virtual": 0,
|
||||
"label": "Tax Category",
|
||||
"length": 0,
|
||||
"link_filters": null,
|
||||
"mandatory_depends_on": null,
|
||||
"modified": "2018-12-28 22:29:21.828090",
|
||||
"module": null,
|
||||
"name": "Address-tax_category",
|
||||
"no_copy": 0,
|
||||
"non_negative": 0,
|
||||
"options": "Tax Category",
|
||||
"permlevel": 0,
|
||||
"placeholder": null,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"print_width": null,
|
||||
"read_only": 0,
|
||||
"read_only_depends_on": null,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"show_dashboard": 0,
|
||||
"sort_options": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0,
|
||||
"width": null
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
@ -12482,63 +12482,6 @@
|
||||
"unique": 0,
|
||||
"width": null
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"collapsible_depends_on": null,
|
||||
"columns": 0,
|
||||
"default": null,
|
||||
"depends_on": null,
|
||||
"description": null,
|
||||
"docstatus": 0,
|
||||
"doctype": "Custom Field",
|
||||
"dt": "Address",
|
||||
"fetch_from": null,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "custom_customers",
|
||||
"fieldtype": "Table",
|
||||
"hidden": 0,
|
||||
"hide_border": 0,
|
||||
"hide_days": 0,
|
||||
"hide_seconds": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "is_service_address",
|
||||
"is_system_generated": 0,
|
||||
"is_virtual": 0,
|
||||
"label": "Customers",
|
||||
"length": 0,
|
||||
"link_filters": null,
|
||||
"mandatory_depends_on": null,
|
||||
"modified": "2026-02-17 08:16:54.701995",
|
||||
"module": null,
|
||||
"name": "Address-custom_customers",
|
||||
"no_copy": 0,
|
||||
"non_negative": 0,
|
||||
"options": "Address Customer Link",
|
||||
"permlevel": 0,
|
||||
"placeholder": null,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"print_width": null,
|
||||
"read_only": 0,
|
||||
"read_only_depends_on": null,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"show_dashboard": 0,
|
||||
"sort_options": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0,
|
||||
"width": null
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
@ -12611,8 +12554,8 @@
|
||||
"dt": "Address",
|
||||
"fetch_from": null,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "custom_section_break_aecpx",
|
||||
"fieldtype": "Section Break",
|
||||
"fieldname": "custom_customers",
|
||||
"fieldtype": "Table",
|
||||
"hidden": 0,
|
||||
"hide_border": 0,
|
||||
"hide_days": 0,
|
||||
@ -12623,19 +12566,19 @@
|
||||
"in_list_view": 0,
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "custom_customers",
|
||||
"insert_after": "is_service_address",
|
||||
"is_system_generated": 0,
|
||||
"is_virtual": 0,
|
||||
"label": "",
|
||||
"label": "Customers",
|
||||
"length": 0,
|
||||
"link_filters": null,
|
||||
"mandatory_depends_on": null,
|
||||
"modified": "2025-01-13 16:23:39.204178",
|
||||
"modified": "2026-02-17 08:16:54.701995",
|
||||
"module": null,
|
||||
"name": "Address-custom_section_break_aecpx",
|
||||
"name": "Address-custom_customers",
|
||||
"no_copy": 0,
|
||||
"non_negative": 0,
|
||||
"options": null,
|
||||
"options": "Address Customer Link",
|
||||
"permlevel": 0,
|
||||
"placeholder": null,
|
||||
"precision": "",
|
||||
@ -12710,6 +12653,63 @@
|
||||
"unique": 0,
|
||||
"width": null
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"collapsible_depends_on": null,
|
||||
"columns": 0,
|
||||
"default": null,
|
||||
"depends_on": null,
|
||||
"description": null,
|
||||
"docstatus": 0,
|
||||
"doctype": "Custom Field",
|
||||
"dt": "Address",
|
||||
"fetch_from": null,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "custom_section_break_aecpx",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"hide_border": 0,
|
||||
"hide_days": 0,
|
||||
"hide_seconds": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "custom_customers",
|
||||
"is_system_generated": 0,
|
||||
"is_virtual": 0,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
"link_filters": null,
|
||||
"mandatory_depends_on": null,
|
||||
"modified": "2025-01-13 16:23:39.204178",
|
||||
"module": null,
|
||||
"name": "Address-custom_section_break_aecpx",
|
||||
"no_copy": 0,
|
||||
"non_negative": 0,
|
||||
"options": null,
|
||||
"permlevel": 0,
|
||||
"placeholder": null,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"print_width": null,
|
||||
"read_only": 0,
|
||||
"read_only_depends_on": null,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"show_dashboard": 0,
|
||||
"sort_options": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0,
|
||||
"width": null
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
|
||||
@ -14929,19 +14929,19 @@
|
||||
},
|
||||
{
|
||||
"default_value": null,
|
||||
"doc_type": "Address",
|
||||
"doc_type": "Task Type",
|
||||
"docstatus": 0,
|
||||
"doctype": "Property Setter",
|
||||
"doctype_or_field": "DocType",
|
||||
"field_name": null,
|
||||
"is_system_generated": 0,
|
||||
"modified": "2026-02-17 08:16:54.459462",
|
||||
"modified": "2026-02-18 03:59:01.922482",
|
||||
"module": null,
|
||||
"name": "Address-main-field_order",
|
||||
"name": "Task Type-main-field_order",
|
||||
"property": "field_order",
|
||||
"property_type": "Data",
|
||||
"row_name": null,
|
||||
"value": "[\"address_details\", \"custom_column_break_vqa4d\", \"custom_column_break_jw2ty\", \"custom_installationservice_address\", \"custom_billing_address\", \"is_shipping_address\", \"is_primary_address\", \"custom_is_compnay_address\", \"custom_column_break_ky1zo\", \"custom_estimate_sent_status\", \"custom_onsite_meeting_scheduled\", \"custom_job_status\", \"custom_payment_received_status\", \"custom_section_break_fvgdt\", \"address_title\", \"primary_contact\", \"address_type\", \"address_line1\", \"address_line2\", \"custom_linked_city\", \"custom_subdivision\", \"is_your_company_address\", \"custom_column_break_3mo7x\", \"state\", \"city\", \"pincode\", \"county\", \"country\", \"full_address\", \"latitude\", \"longitude\", \"onsite_meeting_scheduled\", \"estimate_sent_status\", \"job_status\", \"payment_received_status\", \"custom_column_break_rrto0\", \"custom_customer_to_bill\", \"lead_name\", \"customer_type\", \"customer_name\", \"contacts\", \"companies\", \"quotations\", \"onsite_meetings\", \"projects\", \"sales_orders\", \"tasks\", \"custom_contact_name\", \"phone\", \"email_id\", \"fax\", \"tax_category\", \"disabled\", \"is_service_address\", \"customers\", \"custom_section_break_aecpx\", \"column_break0\", \"custom_show_irrigation_district\", \"custom_google_map\", \"custom_latitude\", \"custom_longitude\", \"custom_address_for_coordinates\", \"linked_with\", \"custom_linked_contacts\", \"links\", \"custom_column_break_9cbvb\", \"custom_linked_companies\", \"custom_irrigation\", \"custom_upcoming_services\", \"custom_service_type\", \"custom_service_route\", \"custom_confirmation_status\", \"custom_backflow_test_form_filed\", \"custom_column_break_j79td\", \"custom_technician_assigned\", \"custom_scheduled_date\", \"custom_column_break_sqplk\", \"custom_test_route\", \"custom_tech\", \"custom_column_break_wcs7g\", \"custom_section_break_zruvq\", \"custom_irrigation_district\", \"custom_serial_\", \"custom_makemodel_\", \"custom_column_break_djjw3\", \"custom_backflow_location\", \"custom_shutoff_location\", \"custom_valve_boxes\", \"custom_timer_type_and_location\", \"custom_column_break_slusf\", \"custom_section_break_5d1cf\", \"custom_installed_by_sprinklers_nw\", \"custom_column_break_th7rq\", \"custom_installed_for\", \"custom_install_month\", \"custom_install_year\", \"custom_column_break_4itse\", \"custom_section_break_xfdtv\", \"custom_backflow_test_report\", \"custom_column_break_oxppn\", \"custom_photo_attachment\"]"
|
||||
"value": "[\"weight\", \"description\", \"base_date\", \"offset_days\", \"skip_weekends\", \"skip_holidays\", \"logic_key\", \"offset_direction\", \"title\", \"days\", \"calculate_from\", \"trigger\", \"task_type_calculate_from\", \"work_type\", \"no_due_date\", \"triggering_doctype\", \"custom_completion_trigger\", \"custom_completion_trigger_doctype\", \"custom_target_percent\"]"
|
||||
},
|
||||
{
|
||||
"default_value": null,
|
||||
@ -14951,7 +14951,23 @@
|
||||
"doctype_or_field": "DocType",
|
||||
"field_name": null,
|
||||
"is_system_generated": 0,
|
||||
"modified": "2026-02-17 08:16:54.562064",
|
||||
"modified": "2026-02-21 16:15:03.709193",
|
||||
"module": null,
|
||||
"name": "Address-main-field_order",
|
||||
"property": "field_order",
|
||||
"property_type": "Data",
|
||||
"row_name": null,
|
||||
"value": "[\"address_details\", \"custom_column_break_vqa4d\", \"custom_column_break_jw2ty\", \"custom_installationservice_address\", \"custom_billing_address\", \"is_shipping_address\", \"is_primary_address\", \"custom_is_compnay_address\", \"custom_column_break_ky1zo\", \"custom_estimate_sent_status\", \"custom_onsite_meeting_scheduled\", \"custom_job_status\", \"custom_payment_received_status\", \"custom_section_break_fvgdt\", \"address_title\", \"primary_contact\", \"address_type\", \"address_line1\", \"address_line2\", \"custom_linked_city\", \"custom_subdivision\", \"is_your_company_address\", \"custom_column_break_3mo7x\", \"state\", \"city\", \"pincode\", \"county\", \"country\", \"full_address\", \"latitude\", \"longitude\", \"onsite_meeting_scheduled\", \"estimate_sent_status\", \"job_status\", \"payment_received_status\", \"custom_column_break_rrto0\", \"custom_customer_to_bill\", \"lead_name\", \"customer_type\", \"customer_name\", \"contacts\", \"companies\", \"quotations\", \"onsite_meetings\", \"projects\", \"sales_orders\", \"tasks\", \"custom_contact_name\", \"phone\", \"email_id\", \"fax\", \"tax_category\", \"disabled\", \"is_service_address\", \"custom_customers\", \"custom_section_break_aecpx\", \"column_break0\", \"custom_show_irrigation_district\", \"custom_google_map\", \"custom_latitude\", \"custom_longitude\", \"custom_address_for_coordinates\", \"linked_with\", \"custom_linked_contacts\", \"links\", \"custom_column_break_9cbvb\", \"custom_linked_companies\", \"custom_irrigation\", \"custom_upcoming_services\", \"custom_service_type\", \"custom_service_route\", \"custom_confirmation_status\", \"custom_backflow_test_form_filed\", \"custom_column_break_j79td\", \"custom_technician_assigned\", \"custom_scheduled_date\", \"custom_column_break_sqplk\", \"custom_test_route\", \"custom_tech\", \"custom_column_break_wcs7g\", \"custom_section_break_zruvq\", \"custom_irrigation_district\", \"custom_serial_\", \"custom_makemodel_\", \"custom_column_break_djjw3\", \"custom_backflow_location\", \"custom_shutoff_location\", \"custom_valve_boxes\", \"custom_timer_type_and_location\", \"custom_column_break_slusf\", \"custom_section_break_5d1cf\", \"custom_installed_by_sprinklers_nw\", \"custom_column_break_th7rq\", \"custom_installed_for\", \"custom_install_month\", \"custom_install_year\", \"custom_column_break_4itse\", \"custom_section_break_xfdtv\", \"custom_backflow_test_report\", \"custom_column_break_oxppn\", \"custom_photo_attachment\"]"
|
||||
},
|
||||
{
|
||||
"default_value": null,
|
||||
"doc_type": "Address",
|
||||
"docstatus": 0,
|
||||
"doctype": "Property Setter",
|
||||
"doctype_or_field": "DocType",
|
||||
"field_name": null,
|
||||
"is_system_generated": 0,
|
||||
"modified": "2026-02-21 16:15:03.800065",
|
||||
"module": null,
|
||||
"name": "Address-main-links_order",
|
||||
"property": "links_order",
|
||||
@ -14967,28 +14983,12 @@
|
||||
"doctype_or_field": "DocType",
|
||||
"field_name": null,
|
||||
"is_system_generated": 0,
|
||||
"modified": "2026-02-17 08:16:54.619557",
|
||||
"modified": "2026-02-21 16:15:03.864609",
|
||||
"module": null,
|
||||
"name": "Address-main-states_order",
|
||||
"property": "states_order",
|
||||
"property_type": "Small Text",
|
||||
"row_name": null,
|
||||
"value": "[\"62m56h85vo\", \"62m5uugrvr\", \"62m57bgpkf\", \"62m5fgrjb0\"]"
|
||||
},
|
||||
{
|
||||
"default_value": null,
|
||||
"doc_type": "Task Type",
|
||||
"docstatus": 0,
|
||||
"doctype": "Property Setter",
|
||||
"doctype_or_field": "DocType",
|
||||
"field_name": null,
|
||||
"is_system_generated": 0,
|
||||
"modified": "2026-02-18 03:59:01.922482",
|
||||
"module": null,
|
||||
"name": "Task Type-main-field_order",
|
||||
"property": "field_order",
|
||||
"property_type": "Data",
|
||||
"row_name": null,
|
||||
"value": "[\"weight\", \"description\", \"base_date\", \"offset_days\", \"skip_weekends\", \"skip_holidays\", \"logic_key\", \"offset_direction\", \"title\", \"days\", \"calculate_from\", \"trigger\", \"task_type_calculate_from\", \"work_type\", \"no_due_date\", \"triggering_doctype\", \"custom_completion_trigger\", \"custom_completion_trigger_doctype\", \"custom_target_percent\"]"
|
||||
}
|
||||
]
|
||||
@ -243,6 +243,14 @@ fixtures = [
|
||||
# ["name", "!=", "Locate Log"], # <-- skip the deleted/removed doctype
|
||||
# ]
|
||||
# },
|
||||
# { "dt": "Item Group" },
|
||||
# { "dt": "UOM" },
|
||||
# { "dt": "Price List" },
|
||||
# { "dt": "Item Price" },
|
||||
# { "dt": "Item" },
|
||||
# { "dt": "BOM"},
|
||||
# { "dt": "BOM Item"},
|
||||
# { "dt": "BOM Explosion Item" },
|
||||
{ "dt": "Task Type" },
|
||||
{
|
||||
"dt": "Task",
|
||||
|
||||
@ -921,18 +921,18 @@ def add_custom_fields():
|
||||
print("✅ Missing custom fields created.")
|
||||
|
||||
if fields_to_update:
|
||||
print("\n🔧 Updating custom fields with mismatched specs:")
|
||||
for doctype, fieldname, field_spec in fields_to_update:
|
||||
print(f" • {doctype}: {fieldname}")
|
||||
custom_field_name = f"{doctype}-{fieldname}"
|
||||
custom_field_doc = frappe.get_doc("Custom Field", custom_field_name)
|
||||
# print("\n🔧 Updating custom fields with mismatched specs:")
|
||||
# for doctype, fieldname, field_spec in fields_to_update:
|
||||
# print(f" • {doctype}: {fieldname}")
|
||||
# custom_field_name = f"{doctype}-{fieldname}"
|
||||
# custom_field_doc = frappe.get_doc("Custom Field", custom_field_name)
|
||||
|
||||
# Update all properties from field_spec
|
||||
for key, value in field_spec.items():
|
||||
if key != "fieldname":
|
||||
setattr(custom_field_doc, key, value)
|
||||
# # Update all properties from field_spec
|
||||
# for key, value in field_spec.items():
|
||||
# if key != "fieldname":
|
||||
# setattr(custom_field_doc, key, value)
|
||||
|
||||
custom_field_doc.save(ignore_permissions=True)
|
||||
# custom_field_doc.save(ignore_permissions=True)
|
||||
|
||||
frappe.db.commit()
|
||||
print("✅ Custom fields updated.")
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user