fix: Move PAN field from standard doctype to fixtures for India
diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json
index 12a09cd..a57d9a9 100644
--- a/erpnext/buying/doctype/supplier/supplier.json
+++ b/erpnext/buying/doctype/supplier/supplier.json
@@ -25,7 +25,6 @@
"column_break0",
"supplier_group",
"supplier_type",
- "pan",
"allow_purchase_invoice_creation_without_purchase_order",
"allow_purchase_invoice_creation_without_purchase_receipt",
"disabled",
@@ -177,11 +176,6 @@
"reqd": 1
},
{
- "fieldname": "pan",
- "fieldtype": "Data",
- "label": "PAN"
- },
- {
"fieldname": "language",
"fieldtype": "Link",
"label": "Print Language",
@@ -438,11 +432,12 @@
"link_fieldname": "party"
}
],
- "modified": "2021-09-06 17:37:56.522233",
+ "modified": "2021-10-20 22:03:33.147249",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier",
"name_case": "Title Case",
+ "naming_rule": "By \"Naming Series\" field",
"owner": "Administrator",
"permissions": [
{
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index e446d6b..9bcab5e 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -310,3 +310,4 @@
erpnext.patches.v13_0.requeue_failed_reposts
erpnext.patches.v13_0.healthcare_deprecation_warning
erpnext.patches.v14_0.delete_healthcare_doctypes
+erpnext.patches.v13_0.create_pan_field_for_india
diff --git a/erpnext/patches/v13_0/create_pan_field_for_india.py b/erpnext/patches/v13_0/create_pan_field_for_india.py
new file mode 100644
index 0000000..e94a9d9
--- /dev/null
+++ b/erpnext/patches/v13_0/create_pan_field_for_india.py
@@ -0,0 +1,25 @@
+import frappe
+from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
+
+
+def execute():
+ custom_fields = {
+ 'Supplier': [
+ {
+ 'fieldname': 'pan',
+ 'label': 'PAN',
+ 'fieldtype': 'Data',
+ 'insert_after': 'supplier_type'
+ }
+ ],
+ 'Customer': [
+ {
+ 'fieldname': 'pan',
+ 'label': 'PAN',
+ 'fieldtype': 'Data',
+ 'insert_after': 'customer_type'
+ }
+ ]
+ }
+
+ create_custom_fields(custom_fields, update=True)
diff --git a/erpnext/regional/india/setup.py b/erpnext/regional/india/setup.py
index afb1b07..1cbb154 100644
--- a/erpnext/regional/india/setup.py
+++ b/erpnext/regional/india/setup.py
@@ -615,10 +615,16 @@
],
'Supplier': [
{
+ 'fieldname': 'pan',
+ 'label': 'PAN',
+ 'fieldtype': 'Data',
+ 'insert_after': 'supplier_type'
+ },
+ {
'fieldname': 'gst_transporter_id',
'label': 'GST Transporter ID',
'fieldtype': 'Data',
- 'insert_after': 'supplier_type',
+ 'insert_after': 'pan',
'depends_on': 'eval:doc.is_transporter'
},
{
@@ -641,10 +647,16 @@
],
'Customer': [
{
+ 'fieldname': 'pan',
+ 'label': 'PAN',
+ 'fieldtype': 'Data',
+ 'insert_after': 'customer_type'
+ },
+ {
'fieldname': 'gst_category',
'label': 'GST Category',
'fieldtype': 'Select',
- 'insert_after': 'customer_type',
+ 'insert_after': 'pan',
'options': 'Registered Regular\nRegistered Composition\nUnregistered\nSEZ\nOverseas\nConsumer\nDeemed Export\nUIN Holders',
'default': 'Unregistered'
},
diff --git a/erpnext/selling/doctype/customer/customer.json b/erpnext/selling/doctype/customer/customer.json
index e811435..fa6e932 100644
--- a/erpnext/selling/doctype/customer/customer.json
+++ b/erpnext/selling/doctype/customer/customer.json
@@ -16,7 +16,6 @@
"customer_name",
"gender",
"customer_type",
- "pan",
"tax_withholding_category",
"default_bank_account",
"lead_name",
@@ -213,8 +212,7 @@
"fieldtype": "Link",
"ignore_user_permissions": 1,
"label": "Represents Company",
- "options": "Company",
- "unique": 1
+ "options": "Company"
},
{
"depends_on": "represents_company",
@@ -487,11 +485,6 @@
"label": "Allow Sales Invoice Creation Without Delivery Note"
},
{
- "fieldname": "pan",
- "fieldtype": "Data",
- "label": "PAN"
- },
- {
"fieldname": "tax_withholding_category",
"fieldtype": "Link",
"label": "Tax Withholding Category",
@@ -517,11 +510,12 @@
"link_fieldname": "party"
}
],
- "modified": "2021-09-06 17:38:54.196663",
+ "modified": "2021-10-20 22:07:52.485809",
"modified_by": "Administrator",
"module": "Selling",
"name": "Customer",
"name_case": "Title Case",
+ "naming_rule": "By \"Naming Series\" field",
"owner": "Administrator",
"permissions": [
{