mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-30 02:14:48 +00:00
Merge pull request #28074 from deepeshgarg007/pan_field_hide_develop
fix: Move PAN field from standard doctype to fixtures for India
This commit is contained in:
@@ -25,7 +25,6 @@
|
|||||||
"column_break0",
|
"column_break0",
|
||||||
"supplier_group",
|
"supplier_group",
|
||||||
"supplier_type",
|
"supplier_type",
|
||||||
"pan",
|
|
||||||
"allow_purchase_invoice_creation_without_purchase_order",
|
"allow_purchase_invoice_creation_without_purchase_order",
|
||||||
"allow_purchase_invoice_creation_without_purchase_receipt",
|
"allow_purchase_invoice_creation_without_purchase_receipt",
|
||||||
"disabled",
|
"disabled",
|
||||||
@@ -176,11 +175,6 @@
|
|||||||
"options": "Company\nIndividual",
|
"options": "Company\nIndividual",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"fieldname": "pan",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "PAN"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"fieldname": "language",
|
"fieldname": "language",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
@@ -438,11 +432,12 @@
|
|||||||
"link_fieldname": "party"
|
"link_fieldname": "party"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modified": "2021-09-06 17:37:56.522233",
|
"modified": "2021-10-20 22:03:33.147249",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Buying",
|
"module": "Buying",
|
||||||
"name": "Supplier",
|
"name": "Supplier",
|
||||||
"name_case": "Title Case",
|
"name_case": "Title Case",
|
||||||
|
"naming_rule": "By \"Naming Series\" field",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -310,3 +310,4 @@ erpnext.patches.v13_0.enable_scheduler_job_for_item_reposting
|
|||||||
erpnext.patches.v13_0.requeue_failed_reposts
|
erpnext.patches.v13_0.requeue_failed_reposts
|
||||||
erpnext.patches.v13_0.healthcare_deprecation_warning
|
erpnext.patches.v13_0.healthcare_deprecation_warning
|
||||||
erpnext.patches.v14_0.delete_healthcare_doctypes
|
erpnext.patches.v14_0.delete_healthcare_doctypes
|
||||||
|
erpnext.patches.v13_0.create_pan_field_for_india #2
|
||||||
|
|||||||
28
erpnext/patches/v13_0/create_pan_field_for_india.py
Normal file
28
erpnext/patches/v13_0/create_pan_field_for_india.py
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import frappe
|
||||||
|
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
|
||||||
|
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
frappe.reload_doc('buying', 'doctype', 'supplier', force=True)
|
||||||
|
frappe.reload_doc('selling', 'doctype', 'customer', force=True)
|
||||||
|
|
||||||
|
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)
|
||||||
@@ -614,11 +614,17 @@ def get_custom_fields():
|
|||||||
fieldtype='Currency', insert_after='monthly_hra_exemption', read_only=1, depends_on='house_rent_payment_amount')
|
fieldtype='Currency', insert_after='monthly_hra_exemption', read_only=1, depends_on='house_rent_payment_amount')
|
||||||
],
|
],
|
||||||
'Supplier': [
|
'Supplier': [
|
||||||
|
{
|
||||||
|
'fieldname': 'pan',
|
||||||
|
'label': 'PAN',
|
||||||
|
'fieldtype': 'Data',
|
||||||
|
'insert_after': 'supplier_type'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'fieldname': 'gst_transporter_id',
|
'fieldname': 'gst_transporter_id',
|
||||||
'label': 'GST Transporter ID',
|
'label': 'GST Transporter ID',
|
||||||
'fieldtype': 'Data',
|
'fieldtype': 'Data',
|
||||||
'insert_after': 'supplier_type',
|
'insert_after': 'pan',
|
||||||
'depends_on': 'eval:doc.is_transporter'
|
'depends_on': 'eval:doc.is_transporter'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -640,11 +646,17 @@ def get_custom_fields():
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
'Customer': [
|
'Customer': [
|
||||||
|
{
|
||||||
|
'fieldname': 'pan',
|
||||||
|
'label': 'PAN',
|
||||||
|
'fieldtype': 'Data',
|
||||||
|
'insert_after': 'customer_type'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'fieldname': 'gst_category',
|
'fieldname': 'gst_category',
|
||||||
'label': 'GST Category',
|
'label': 'GST Category',
|
||||||
'fieldtype': 'Select',
|
'fieldtype': 'Select',
|
||||||
'insert_after': 'customer_type',
|
'insert_after': 'pan',
|
||||||
'options': 'Registered Regular\nRegistered Composition\nUnregistered\nSEZ\nOverseas\nConsumer\nDeemed Export\nUIN Holders',
|
'options': 'Registered Regular\nRegistered Composition\nUnregistered\nSEZ\nOverseas\nConsumer\nDeemed Export\nUIN Holders',
|
||||||
'default': 'Unregistered'
|
'default': 'Unregistered'
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ def validate_gstin_for_india(doc, method):
|
|||||||
.format(doc.gst_state_number), title=_("Invalid GSTIN"))
|
.format(doc.gst_state_number), title=_("Invalid GSTIN"))
|
||||||
|
|
||||||
def validate_pan_for_india(doc, method):
|
def validate_pan_for_india(doc, method):
|
||||||
if doc.get('country') != 'India' or not doc.pan:
|
if doc.get('country') != 'India' or not doc.get('pan'):
|
||||||
return
|
return
|
||||||
|
|
||||||
if not PAN_NUMBER_FORMAT.match(doc.pan):
|
if not PAN_NUMBER_FORMAT.match(doc.pan):
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
"customer_name",
|
"customer_name",
|
||||||
"gender",
|
"gender",
|
||||||
"customer_type",
|
"customer_type",
|
||||||
"pan",
|
|
||||||
"tax_withholding_category",
|
"tax_withholding_category",
|
||||||
"default_bank_account",
|
"default_bank_account",
|
||||||
"lead_name",
|
"lead_name",
|
||||||
@@ -486,11 +485,6 @@
|
|||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Allow Sales Invoice Creation Without Delivery Note"
|
"label": "Allow Sales Invoice Creation Without Delivery Note"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"fieldname": "pan",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "PAN"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"fieldname": "tax_withholding_category",
|
"fieldname": "tax_withholding_category",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
@@ -517,11 +511,12 @@
|
|||||||
"link_fieldname": "party"
|
"link_fieldname": "party"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modified": "2021-09-06 17:38:54.196663",
|
"modified": "2021-10-20 22:07:52.485809",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"name": "Customer",
|
"name": "Customer",
|
||||||
"name_case": "Title Case",
|
"name_case": "Title Case",
|
||||||
|
"naming_rule": "By \"Naming Series\" field",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user