chore: add validation for depreciation expense account in asset category (#36659)

This commit is contained in:
Anand Baburajan 2023-08-15 15:47:15 +05:30 committed by GitHub
parent 1e07f6eef9
commit e0c79d3b53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -33,6 +33,7 @@ frappe.ui.form.on('Asset Category', {
var d = locals[cdt][cdn]; var d = locals[cdt][cdn];
return { return {
"filters": { "filters": {
"account_type": "Depreciation",
"root_type": ["in", ["Expense", "Income"]], "root_type": ["in", ["Expense", "Income"]],
"is_group": 0, "is_group": 0,
"company": d.company_name "company": d.company_name

View File

@ -53,7 +53,7 @@ class AssetCategory(Document):
account_type_map = { account_type_map = {
"fixed_asset_account": {"account_type": ["Fixed Asset"]}, "fixed_asset_account": {"account_type": ["Fixed Asset"]},
"accumulated_depreciation_account": {"account_type": ["Accumulated Depreciation"]}, "accumulated_depreciation_account": {"account_type": ["Accumulated Depreciation"]},
"depreciation_expense_account": {"root_type": ["Expense", "Income"]}, "depreciation_expense_account": {"account_type": ["Depreciation"]},
"capital_work_in_progress_account": {"account_type": ["Capital Work in Progress"]}, "capital_work_in_progress_account": {"account_type": ["Capital Work in Progress"]},
} }
for d in self.accounts: for d in self.accounts: