Skip to content

Commit

Permalink
chore: tab for loan in company doc
Browse files Browse the repository at this point in the history
  • Loading branch information
anandbaburajan committed Sep 10, 2023
1 parent 5edc283 commit 82d8232
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lending/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@
}
],
"Company": [
{
"fieldname": "loan_tab",
"fieldtype": "Tab Break",
"label": "Loan",
"insert_after": "expenses_included_in_valuation",
},
{
"fieldname": "loan_settings",
"label": "Loan Settings",
"fieldtype": "Section Break",
"insert_after": "exception_budget_approver_role",
"insert_after": "loan_tab",
},
{
"fieldname": "loan_restructure_limit",
Expand Down
3 changes: 2 additions & 1 deletion lending/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ lending.patches.v15_0.rename_process_asset_classification_doctype
lending.patches.v15_0.update_loan_types
lending.patches.v15_0.create_custom_fields #6
lending.patches.v15_0.make_loan_type_non_submittable
lending.patches.v15_0.rename_asset_classification_ranges
lending.patches.v15_0.rename_asset_classification_ranges
lending.patches.v15_0.update_custom_fields_for_company_tab
27 changes: 27 additions & 0 deletions lending/patches/v15_0/update_custom_fields_for_company_tab.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt


import frappe
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields


def execute():
create_custom_fields(
{
"Company": [
{
"fieldname": "loan_tab",
"fieldtype": "Tab Break",
"label": "Loan",
"insert_after": "expenses_included_in_valuation",
},
]
},
ignore_validate=True,
)

if frappe.db.exists("Custom Field", {"name": "Company-loan_settings"}):
frappe.db.set_value(
"Custom Field", {"name": "Company-loan_settings"}, "insert_after", "loan_tab"
)

0 comments on commit 82d8232

Please sign in to comment.