From c8ad6d1b2c4407992fc415dc7ee1d0b7b2613eca 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 --- erpnext/buying/doctype/supplier/supplier.json | 2 +- erpnext/buying/doctype/supplier/supplier.py | 2 +- erpnext/patches.txt | 1 + .../patches/v14_0/update_proprietorship_to_individual.py | 7 +++++++ erpnext/selling/doctype/customer/customer.json | 2 +- erpnext/selling/doctype/customer/customer.py | 2 +- 6 files changed, 12 insertions(+), 4 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 f38284b1302..c35abc9c122 100644 --- a/erpnext/buying/doctype/supplier/supplier.json +++ b/erpnext/buying/doctype/supplier/supplier.json @@ -174,7 +174,7 @@ "fieldname": "supplier_type", "fieldtype": "Select", "label": "Supplier Type", - "options": "Company\nIndividual\nProprietorship\nPartnership", + "options": "Company\nIndividual\nPartnership", "reqd": 1 }, { diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py index ff5385dd961..bccab8b01e0 100644 --- a/erpnext/buying/doctype/supplier/supplier.py +++ b/erpnext/buying/doctype/supplier/supplier.py @@ -65,7 +65,7 @@ class Supplier(TransactionBase): supplier_name: DF.Data supplier_primary_address: DF.Link | None supplier_primary_contact: DF.Link | None - supplier_type: DF.Literal["Company", "Individual", "Proprietorship", "Partnership"] + supplier_type: DF.Literal["Company", "Individual", "Partnership"] tax_category: DF.Link | None tax_id: DF.Data | None tax_withholding_category: DF.Link | None diff --git a/erpnext/patches.txt b/erpnext/patches.txt index fe5a0a1e995..780d5441b11 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -260,6 +260,7 @@ erpnext.patches.v15_0.delete_saudi_doctypes erpnext.patches.v14_0.show_loan_management_deprecation_warning erpnext.patches.v14_0.clear_reconciliation_values_from_singles execute:frappe.rename_doc("Report", "TDS Payable Monthly", "Tax Withholding Details", force=True) +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 13188f2e815..4ce8d942154 100644 --- a/erpnext/selling/doctype/customer/customer.json +++ b/erpnext/selling/doctype/customer/customer.json @@ -134,7 +134,7 @@ "label": "Customer Type", "oldfieldname": "customer_type", "oldfieldtype": "Select", - "options": "Company\nIndividual\nProprietorship\nPartnership", + "options": "Company\nIndividual\nPartnership", "reqd": 1 }, { diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index 3daddbe5192..0610c11fa9f 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -51,7 +51,7 @@ class Customer(TransactionBase): customer_pos_id: DF.Data | None customer_primary_address: DF.Link | None customer_primary_contact: DF.Link | None - customer_type: DF.Literal["Company", "Individual", "Proprietorship", "Partnership"] + customer_type: DF.Literal["Company", "Individual", "Partnership"] default_bank_account: DF.Link | None default_commission_rate: DF.Float default_currency: DF.Link | None