From 8c1f6196b82f024f8f768ee767705b86e9ba89f5 Mon Sep 17 00:00:00 2001 From: Sanket322 Date: Fri, 12 Jul 2024 18:58:14 +0530 Subject: [PATCH] fix: remove proprietorship and update it with individual (backport #42307) --- erpnext/buying/doctype/supplier/supplier.json | 2 +- erpnext/patches.txt | 1 + .../patches/v14_0/update_proprietorship_to_individual.py | 7 +++++++ erpnext/selling/doctype/customer/customer.json | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 erpnext/patches/v14_0/update_proprietorship_to_individual.py diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json index 944eb985246..5ee1604415d 100644 --- a/erpnext/buying/doctype/supplier/supplier.json +++ b/erpnext/buying/doctype/supplier/supplier.json @@ -170,7 +170,7 @@ "fieldname": "supplier_type", "fieldtype": "Select", "label": "Supplier Type", - "options": "Company\nIndividual\nProprietorship\nPartnership", + "options": "Company\nIndividual\nPartnership", "reqd": 1 }, { diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 25f038173d6..1f6363d56cb 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -271,6 +271,7 @@ erpnext.patches.v13_0.create_accounting_dimensions_for_asset_repair erpnext.patches.v14_0.update_reference_due_date_in_journal_entry erpnext.patches.v14_0.france_depreciation_warning erpnext.patches.v14_0.clear_reconciliation_values_from_singles +erpnext.patches.v14_0.update_proprietorship_to_individual [post_model_sync] execute:frappe.delete_doc_if_exists('Workspace', 'ERPNext Integrations Settings') diff --git a/erpnext/patches/v14_0/update_proprietorship_to_individual.py b/erpnext/patches/v14_0/update_proprietorship_to_individual.py new file mode 100644 index 00000000000..dc4ec15e86b --- /dev/null +++ b/erpnext/patches/v14_0/update_proprietorship_to_individual.py @@ -0,0 +1,7 @@ +import frappe + + +def execute(): + for doctype in ["Customer", "Supplier"]: + field = doctype.lower() + "_type" + frappe.db.set_value(doctype, {field: "Proprietorship"}, field, "Individual") diff --git a/erpnext/selling/doctype/customer/customer.json b/erpnext/selling/doctype/customer/customer.json index e272f09679c..ecf164496bb 100644 --- a/erpnext/selling/doctype/customer/customer.json +++ b/erpnext/selling/doctype/customer/customer.json @@ -131,7 +131,7 @@ "label": "Customer Type", "oldfieldname": "customer_type", "oldfieldtype": "Select", - "options": "Company\nIndividual\nProprietorship\nPartnership", + "options": "Company\nIndividual\nPartnership", "reqd": 1 }, {