Rothamsted-Ecoinformatics / farm_rothamsted

Custom farmOS features for Rothamsted Research.
GNU General Public License v2.0
6 stars 1 forks source link

Quick Forms: Specification error on Fertiliser Quick Form (Update Hook) #594

Open aislinnpearson opened 11 months ago

aislinnpearson commented 11 months ago

Following a call on 11/12/2023 we agreed that we would wait to push the update hook for issue #588 because we aren't sure how people have been using this data field and it needs review before updating. Assigned to Aislinn to review before @paul121 pushes any changes.

Marked as should do because may be that data fields need to be updated manually (depends on outcome of looking into the values). It could also be updated via the API.

aislinnpearson commented 10 months ago

Three things to change:

  1. Change all to Total applied so naming is consistent.
  2. Check if the units of rate is equivalent to the total applied (e.g. if kg/ha as a rate, total must be in kg too).
  3. Mapping to look at unit. If kg, g or t then it's a weight, if ml, l or gallons then it's a volume.

As an aside, we could use form validation to ensure that the rate unit matches the total rate. This means that we might want to hardcode the units in the quick form to ensure this can't be edited/ amended with units rated to volume (or possibly as a unit pair, so change one and the other changes). Also what happens if you use multiple products - would you need multiple? We also agreed we couldn't calculate this because the field area may not be the same as the treated area.

Agreed that a good place to start is with a database query to identify incorrect logs before running any updates.

Aislinn to take a look at what can be done via the API/ user interface.