erpnext icon indicating copy to clipboard operation
erpnext copied to clipboard

feat: Allow unique Account number by root type (not unique for accros all Accounts)

Open FHenry opened this issue 1 year ago • 0 comments

Please provide enough information so that others can review your pull request:

In France we have chart of account where the same Account number can be use as Liability or as Asset ( the root_type do not exists like that but in France, it imply other definition and meaning but we try to find a way to allow proper French accountancy in ERPNext)

We can understand that add root_type to the check the uniqueness of a Account number may not please all country accountancy rules. So we can also change the PR to always send root_type as parameters and not use it for standard/core test of uniqueness but add @erpnext.allow_regional on the validate_account_number() function. Like that we can override it in ERPNext France app

Explain the details for making this change. What existing problem does the pull request solve?

This PR make two changes :

Use the same method/function on Account creation as on Account update to check the validity of the account number
Send root_type as parameters to validate_account_number() to check account number uniqueness by company and root_type

no-docs

FHenry avatar Jul 10 '24 18:07 FHenry