Skip to content

feat: enhance account category with root type#53190

Open
Abdeali099 wants to merge 12 commits intofrappe:developfrom
Abdeali099:Abdeali/account-category-enhancement
Open

feat: enhance account category with root type#53190
Abdeali099 wants to merge 12 commits intofrappe:developfrom
Abdeali099:Abdeali/account-category-enhancement

Conversation

@Abdeali099
Copy link
Contributor

@Abdeali099 Abdeali099 commented Mar 5, 2026

UX Feature

  • Filtering Account Category based on Root Type of COA.

  • no-docs

Note

Backport to V-16

@Abdeali099 Abdeali099 requested a review from ruthra-kumar as a code owner March 5, 2026 12:45
@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Mar 5, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: a2c5dd0e-8fca-42e5-a6dc-efa1d9a92b47

📥 Commits

Reviewing files that changed from the base of the PR and between c3fa967 and 7577e60.

📒 Files selected for processing (1)
  • erpnext/patches.txt

📝 Walkthrough

Walkthrough

Adds a new Select field root_type to Account Category (schema and list/search metadata), inserts a column break field, and adds a link from Account Category to Account. Updates the account category JSON data file to assign root_type for every category. Adds a TYPE_CHECKING type hint for root_type on the AccountCategory class. Modifies Account client script: moves account_category query into setup, adds a root_type(frm) handler that clears account_category when needed, and adjusts the query to filter by the current root_type. Adds a patch script and patches entry to populate existing records with root_type.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: enhance account category with root type' directly and concisely describes the main change - adding root type capability to account categories as shown across all modified files.
Description check ✅ Passed The description is related to the changeset, explaining the UX feature of filtering Account Category based on Root Type of Chart of Accounts, which aligns with the implemented changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.37%. Comparing base (a15e5fd) to head (7577e60).
⚠️ Report is 50 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #53190      +/-   ##
===========================================
- Coverage    79.37%   79.37%   -0.01%     
===========================================
  Files         1170     1170              
  Lines       124199   124224      +25     
===========================================
+ Hits         98578    98597      +19     
- Misses       25621    25627       +6     
Files with missing lines Coverage Δ
...ounts/doctype/account_category/account_category.py 71.79% <ø> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vorasmit vorasmit added squash Meant to tell reviewers that this PR should be squashed into a single commit while merging. backport version-16-hotfix labels Mar 6, 2026
@sanjay-kumar001
Copy link

@Abdeali099 Abdeali099, thank you so much for adding this feature.
Highly appreciated.

I have one more suggesion to add a new doctype named as Sub Root Type (in read_only mode) and link it to both in COA and Account Category.

Introducing a Sub Root Type in the Chart of Accounts (COA) and Account Category will enhance the efficiency and accuracy of Financial Analysis..

I can develop and add this feature if everyone agrees.


Sub Root Type

Root Type Sub Root Type
Expense Indirect Expense
Expense Direct Expense
Income Indirect Income
Income Direct Income
Liability Other Liability
Liability Current Liability
Liability Long Term Liability
Asset Loan and Advance
Asset Other Asset
Asset Investment
Asset Current Asset
Asset Fixed Asset
Equity Shareholder Current Account
Equity Reserve and Surplus
Equity Share Capital

@sanjay-kumar001
Copy link

Account Category after adding Root Type and Sub Root Type

Root Type Sub Root Type Account Category
Asset Current Asset Cash and Cash Equivalents
Asset Current Asset Other Current Assets
Asset Current Asset Other Receivables
Asset Current Asset Short-term Investments
Asset Current Asset Stock Assets
Asset Current Asset Trade Receivables
Asset Loan and Advance Loan and Advance
Asset Fixed Asset Fixed Asset
Asset Investment Long-term Investments
Asset Other Asset Intangible Assets
Asset Other Asset Other Non-current Assets
Asset Other Asset Tangible Assets
Equity Reserve and Surplus Reserves and Surplus
Equity Share Capital Share Capital
Equity Shareholder Current Account Shareholder Current Account
Expense Direct Expense Cost of Goods Sold
Expense Direct Expense Operating Expenses
Expense Direct Expense Other Direct Costs
Expense Indirect Expense Finance Costs
Expense Indirect Expense Tax Expense
Income Direct Income Other Operating Income
Income Direct Income Revenue from Sales of Services
Income Direct Income Revenue from Sales of Goods
Income Direct Income Revenue from Operations
Income Indirect Income Investment Income
Liability Current Liability Current Tax Liabilities
Liability Current Liability Other Current Liabilities
Liability Current Liability Other Payables
Liability Current Liability Short-term Borrowings
Liability Current Liability Short-term Provisions
Liability Current Liability Trade Payables
Liability Other Asset Other Non-current Liabilities
Liability Other Liability Long-term Borrowings
Liability Other Liability Long-term Provisions

After this, one can easily do Ratio and Other Financial Analysis.

@Abdeali099
Copy link
Contributor Author

Thanks for the suggestion.

Will take the opinion of the team.

@sanjay-kumar001
Copy link

@Abdeali099 any update on adding Sub Root Type?

@Abdeali099
Copy link
Contributor Author

@Abdeali099 any update on adding Sub Root Type?

Hello,

Currently we will not implement this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport version-16-hotfix needs-tests This PR needs automated unit-tests. squash Meant to tell reviewers that this PR should be squashed into a single commit while merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants