OpenSPP / openspp-modules

OpenSPP Odoo modules
https://openspp.org
GNU Lesser General Public License v3.0
26 stars 11 forks source link

Farmer tabs are retaining deleted values from species #594

Closed anthonymarkQA closed 2 days ago

anthonymarkQA commented 1 month ago

Describe the bug Values for crops, livestock, aquaculture are retained even when deleting the corresponding value from Configuration>species in Farmer Registry

To Reproduce

  1. go to farmer-registry QA
  2. In registry select a farm group
  3. go to crop agriculture tab, and add a new value, select whatever crop you wish.
  4. under purpose column, add anything you want.
  5. after saving. go to Configuration>species
  6. search for the value that you have added from step 3
  7. click on the checkbox beside it >click action>delete.
  8. go back to the particular farmer selected from step 2
  9. click on crop agriculture tab, notice under species column, there is no more value but the line created still exists.

Expected behavior When a value is deleted from Registry>Configuration>species, it should also remove the already existing relationship with the farm groups that have it. Screenshots Image Image

Additional context

🔔 Note: This ticket should address common considerations without including country-specific content. Please ensure all references are generic and applicable across various contexts.

celinenilla commented 3 weeks ago

@singhkaranvir25 , can you please help analyze the validity of this?

singhkaranvir25 commented 3 weeks ago

@celinenilla @anthonymarkQA - I confirm that this is a valid request and this behaviour logic needs to be fixed throughout i.e. not only "Crop Agriculture" tab but also for other similar tabs such as "Live Stock", "Aquaculture" etc.

anjclarise commented 4 days ago

Verified this ticket and now working as expected.

Steps:

  1. go to farmer-registry QA
  2. In registry select a farm group
  3. go to crop agriculture tab, and add a new value, select whatever crop you wish.
  4. under purpose column, add anything you want.
  5. after saving. go to Configuration>species
  6. search for the value that you have added from step 3
  7. click on the checkbox beside it >click action>delete.

Current behavior: When a crop is added from a farm group, deleting the crop would show an error message to the user and un-allow the user to delete the said crop.

Validation error when trying to delete the crop that is added to a farm group: Image

Image