diff --git a/csf_tz/__init__.py b/csf_tz/__init__.py index 95acbb0d..57a4e74d 100755 --- a/csf_tz/__init__.py +++ b/csf_tz/__init__.py @@ -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 diff --git a/csf_tz/setup_data/accounts.json b/csf_tz/setup_data/accounts.json index 1e542ea8..41c998cd 100644 --- a/csf_tz/setup_data/accounts.json +++ b/csf_tz/setup_data/accounts.json @@ -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}", @@ -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" },