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

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

(cherry picked from commit e0c79d3b53)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
This commit is contained in:
mergify[bot]
2023-08-15 18:26:33 +05:30
committed by GitHub
parent e5b38607ce
commit 84b6f68108
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];
return {
"filters": {
"account_type": "Depreciation",
"root_type": ["in", ["Expense", "Income"]],
"is_group": 0,
"company": d.company_name

View File

@@ -53,7 +53,7 @@ class AssetCategory(Document):
account_type_map = {
"fixed_asset_account": {"account_type": ["Fixed Asset"]},
"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"]},
}
for d in self.accounts: