Skip to content

Conversation

yashtilala412
Copy link

@yashtilala412 yashtilala412 commented Sep 29, 2025

This PR introduces a crucial validation to the Fee Category Doctype to ensure accounting defaults are defined for all active, non-group companies in a multi-company environment. This prevents fatal errors in downstream financial transactions.

What has been changed?
Validation Added: A new method, validate_all_companies_covered, is added to the FeeCategory class in fee_category.py.

Validation Trigger: This method is called during the validate hook, checking if every active company in the system has a corresponding entry in the item_defaults (Accounting Defaults) table.

New Test Case: A new unit test, test_missing_company_default, has been added to test_fee_category.py to confirm the validation throws a ValidationError when a company's defaults are missing.

Why is this necessary? (Problem Solved)
In a multi-company setup, if a user creates a Fees Invoice for a company whose accounting defaults were not set in the Fee Category, the system will crash because it cannot find the mandatory Income Account and Selling Cost Center for that specific entity. This change forces the user to complete the setup at the master data level, guaranteeing that fee transactions will not fail later due to missing configuration.

frappe1

@ankushkumarkanna555-afk

best education****UP Board 9th to 12

@yashtilala412
Copy link
Author

best education****UP Board 9th to 12

i cannot understand what you want?i mean is this message is related for what

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants