fix: remove validate_name_in_customer function (backport #41025) #44221
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem:
When we create a customer group the function "validate_name_with_customer" is called which checks whether the name of customer group exists in "Customer" DocType.
For e.g.
If we create a customer group called "XYZ", in the on_update method in customer_group.py file, the code will check whether a customer with a name of "XYZ" is already created or not. If it is created it throws an error "A customer with the same name already exists".
Solution:
Remove validate_name_with_customer from "customer_group.py" file.
This is an automatic backport of pull request #41025 done by Mergify.