Skip to content

Commit

Permalink
chore: Code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillarAnand committed Sep 20, 2021
1 parent c8565c7 commit 960f5a7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions erpnext/non_profit/doctype/donation/donation.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ def create_donor(payment):

def get_company_for_donations():
company = frappe.db.get_single_value('Non Profit Settings', 'donation_company')
if not company:
from erpnext.non_profit.utils import get_company
company = get_company()
return company


Expand Down
3 changes: 3 additions & 0 deletions erpnext/non_profit/doctype/membership/membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@ def process_request_data(data):

def get_company_for_memberships():
company = frappe.db.get_single_value("Non Profit Settings", "company")
if not company:
from erpnext.non_profit.utils import get_company
company = get_company()
return company


Expand Down
12 changes: 12 additions & 0 deletions erpnext/non_profit/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import frappe


def get_company():
company = frappe.defaults.get_defaults().company
if company:
return company
else:
company = frappe.get_list("Company", limit=1)
if company:
return company[0].name
return None
2 changes: 0 additions & 2 deletions erpnext/patches/v11_0/refactor_naming_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
'Blanket Order': 'MFG-BLR-.YYYY.-',
'C-Form': 'ACC-CF-.YYYY.-',
'Campaign': 'SAL-CAM-.YYYY.-',
'Clinical Procedure': 'HLC-CPR-.YYYY.-',
'Course Schedule': 'EDU-CSH-.YYYY.-',
'Customer': 'CUST-.YYYY.-',
'Delivery Note': 'MAT-DN-.YYYY.-',
Expand All @@ -31,7 +30,6 @@
'Instructor': 'EDU-INS-.YYYY.-',
'Issue': 'ISS-.YYYY.-',
'Journal Entry': 'ACC-JV-.YYYY.-',
'Lab Test': 'HLC-LT-.YYYY.-',
'Landed Cost Voucher': 'MAT-LCV-.YYYY.-',
'Lead': 'CRM-LEAD-.YYYY.-',
'Leave Allocation': 'HR-LAL-.YYYY.-',
Expand Down

0 comments on commit 960f5a7

Please sign in to comment.