diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-03-09 12:07:20 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-03-09 12:07:20 +0100 |
commit | c737d107405e79aa0d014400231bf3470bb15f71 (patch) | |
tree | 3fd84934542204953eae3124ae23400e770474e9 /archaeological_warehouse/models.py | |
parent | db88ec5f327837d25aa142da13faa5e3c9b212da (diff) | |
download | Ishtar-c737d107405e79aa0d014400231bf3470bb15f71.tar.bz2 Ishtar-c737d107405e79aa0d014400231bf3470bb15f71.zip |
Container: weight on form - fix weight display on sheet
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r-- | archaeological_warehouse/models.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 089a021af..fc0184990 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -962,7 +962,7 @@ class Container(DocumentItem, Merge, LightHistorizedItem, related_name="children", blank=True, null=True) index = models.IntegerField(_("Container ID"), blank=True, null=True, db_index=True) - weight = models.FloatField(_("Weight (g)"), blank=True, null=True) + weight = models.FloatField(_("Measured weight (g)"), blank=True, null=True) calculated_weight = models.FloatField( _("Calculated weight (g)"), blank=True, null=True) cached_weight = models.FloatField( @@ -1102,9 +1102,9 @@ class Container(DocumentItem, Merge, LightHistorizedItem, @property def get_calculated_weight_percent(self): if not self.calculated_weight or not self.weight: - return (self.calculated_weight - - self.weight) / self.calculated_weight * 100 - return 0 + return 0 + return (self.calculated_weight + - self.weight) / self.calculated_weight * 100 @property def get_cached_division(self): |