Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use common functionality to validate account number #42842

Merged
merged 1 commit into from
Sep 21, 2024

Conversation

FHenry
Copy link
Contributor

@FHenry FHenry commented Aug 20, 2024

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

Following #42279

Copy link

stale bot commented Sep 8, 2024

This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing.

@stale stale bot added the inactive label Sep 8, 2024
@vorasmit vorasmit self-assigned this Sep 9, 2024
@stale stale bot removed the inactive label Sep 9, 2024
@umairsy
Copy link
Member

umairsy commented Sep 20, 2024

@ruthra-kumar could we review this PR in reference to discussion in the previous PR? This will help us make ERPNext France comprehensive. It's already listed on FC Marketplace and available for installation.

Cc: @vorasmit

@vorasmit vorasmit changed the title feat: Allow unique Account number by root type (not unique for accros all Accounts) refactor: use common functionality to validate account number Sep 21, 2024
@vorasmit vorasmit merged commit 40d97f4 into frappe:develop Sep 21, 2024
15 checks passed
mergify bot pushed a commit that referenced this pull request Sep 21, 2024
feat: Allow unique Account number by root type (not unique for accros all Accounts)
(cherry picked from commit 40d97f4)
vorasmit added a commit that referenced this pull request Sep 21, 2024
…-42842

refactor: use common functionality to validate account number (backport #42842)
@FHenry FHenry deleted the fix_acounting_number_filtering branch September 21, 2024 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport version-15-hotfix needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants