Skip to content

Commit

Permalink
fix: add company_data_to_be_ignored hook
Browse files Browse the repository at this point in the history
(cherry picked from commit ae7e577)
  • Loading branch information
AyshaHakeem authored and mergify[bot] committed Jan 24, 2025
1 parent 5d50429 commit 4ba4193
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hrms/hooks.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from hrms.overrides.company import get_company_data_to_be_ignored

app_name = "hrms"
app_title = "Frappe HR"
app_publisher = "Frappe Technologies Pvt. Ltd."
Expand Down Expand Up @@ -168,6 +170,7 @@
"hrms.overrides.company.make_company_fixtures",
"hrms.overrides.company.set_default_hr_accounts",
],
"on_trash": "hrms.overrides.company.unset_company_field",
},
"Holiday List": {
"on_update": "hrms.utils.holiday_list.invalidate_cache",
Expand Down Expand Up @@ -347,3 +350,5 @@
# Recommended only for DocTypes which have limited documents with untranslated names
# For example: Role, Gender, etc.
# translated_search_doctypes = []

company_data_to_be_ignored = get_company_data_to_be_ignored()
18 changes: 18 additions & 0 deletions hrms/overrides/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,21 @@ def validate_default_accounts(doc, method=None):
"The currency of {0} should be same as the company's default currency. Please select another account."
).format(frappe.bold(_("Default Payroll Payable Account")))
)


def get_company_data_to_be_ignored():
if "erpnext" in frappe.get_installed_apps():
return [
"Salary Component Account",
"Salary Structure",
"Salary Structure Assignment",
"Payroll Period",
"Income Tax Slab",
"Leave Policy",
"Leave Period",
"Leave Policy Assignment",
"Employee Onboarding Template",
"Employee Separation Template",
"Job Offer Term Template",
]
return []

0 comments on commit 4ba4193

Please sign in to comment.