Add validation in Import Group for Farmer registry
Describe the bug An "unnamed" member is automatically created under the group , when importing a group with no memmbers To Reproduce
- Go to Farmer registry QA
- Login as admin
- Click on Groups
- Click the gear icon then click "Import records"
- Click on Upload file and select the file attached from this ticket
- Go back to groups and check the group you have imported,
- go to "members" tab and notice there is "unnamed" individual created and assigned as head automatically
Expected behavior
raise error message and prevent import when importing group with no head member in farmer registry
Screenshots
Additional context Contact (res.partner) - 2024-08-13T160654.164.xlsx
Findings: Returned to DEV
Prerequisite: upgrade module "spp_farmer_registry_base"
The solution works, however, user has to put "is_group" header for the validation to check the imported file. so that the unnamed member will not be created .
Expected:
Put the validation in the import page for GROUPS without the need for "is_group" header.
Add in the error message
farmer_given_name and farmer_family_name must be present in the excel file.
Apply for FARMER REGISTRY>groups only.
Findings: Returned to DEV
This fix should be applied for group import in farmer registry only as indicated. Currently it got unexpectedly applied for Import Individual for farmer registry as well.
Findings: QA Passed Verified in QA farmer registry base instance
-
Able to import individual in farmer registry without farmer_given_name and Farmer_family_name validation erros - PASS
-
Able to trigger error message "farmer_given_name and farmer_family_name must be present in the excel file." when both fields are missing from the excel. - PASS