mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-25 06:02:09 +01:00
fix(patch): create only 80G custom fields instead of running the whole setup (#34183)
This commit is contained in:
@@ -1,16 +1,61 @@
|
|||||||
import frappe
|
import frappe
|
||||||
|
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
|
||||||
from erpnext.regional.india.setup import make_custom_fields
|
|
||||||
|
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
if frappe.get_all("Company", filters={"country": "India"}):
|
if frappe.get_all("Company", filters={"country": "India"}):
|
||||||
frappe.reload_doc("accounts", "doctype", "POS Invoice")
|
custom_fields = get_non_profit_custom_fields()
|
||||||
frappe.reload_doc("accounts", "doctype", "POS Invoice Item")
|
create_custom_fields(custom_fields, update=True)
|
||||||
|
|
||||||
make_custom_fields()
|
|
||||||
|
|
||||||
if not frappe.db.exists("Party Type", "Donor"):
|
if not frappe.db.exists("Party Type", "Donor"):
|
||||||
frappe.get_doc(
|
frappe.get_doc(
|
||||||
{"doctype": "Party Type", "party_type": "Donor", "account_type": "Receivable"}
|
{"doctype": "Party Type", "party_type": "Donor", "account_type": "Receivable"}
|
||||||
).insert(ignore_permissions=True)
|
).insert(ignore_permissions=True, ignore_mandatory=True)
|
||||||
|
|
||||||
|
|
||||||
|
def get_non_profit_custom_fields():
|
||||||
|
return {
|
||||||
|
"Company": [
|
||||||
|
{
|
||||||
|
"fieldname": "non_profit_section",
|
||||||
|
"label": "Non Profit Settings",
|
||||||
|
"fieldtype": "Section Break",
|
||||||
|
"insert_after": "asset_received_but_not_billed",
|
||||||
|
"collapsible": 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "company_80g_number",
|
||||||
|
"label": "80G Number",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"insert_after": "non_profit_section",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "with_effect_from",
|
||||||
|
"label": "80G With Effect From",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"insert_after": "company_80g_number",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "pan_details",
|
||||||
|
"label": "PAN Number",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"insert_after": "with_effect_from",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"Member": [
|
||||||
|
{
|
||||||
|
"fieldname": "pan_number",
|
||||||
|
"label": "PAN Details",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"insert_after": "email_id",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"Donor": [
|
||||||
|
{
|
||||||
|
"fieldname": "pan_number",
|
||||||
|
"label": "PAN Details",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"insert_after": "email",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user