Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions csf_tz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,18 @@ def load_monkey_patches():
if patches_loaded:
return

# Site-less contexts (`bench build`, etc.) must not force a DB
# connection; the frappe.connect patch loads these later anyway.
if not getattr(frappe.local, "site", None):
return

patches_loaded = True

if app_name not in frappe.get_installed_apps():
return

patches_loaded = True

for module_name in os.listdir(frappe.get_app_path(app_name, "monkey_patches")):
if not module_name.endswith(".py") or module_name == "__init__.py":
continue
Expand Down
4 changes: 2 additions & 2 deletions csf_tz/setup_data/accounts.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
{
"doctype": "Account",
"account_name": "Bank Charges",
"account_name": "Bank Charges Accounts",
"company": "{company}",
"account_currency": "TZS",
"parent_account": "Financial Charges - {abbr}",
Expand Down Expand Up @@ -147,7 +147,7 @@
"account_name": "Bank Charges TZS",
"company": "{company}",
"account_currency": "TZS",
"parent_account": "Bank Charges - {abbr}",
"parent_account": "Bank Charges Accounts - {abbr}",
"root_type": "Expense",
"report_type": "Profit and Loss"
},
Expand Down
Loading