diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-22 12:07:32 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-22 12:07:32 +0200 |
commit | a54bcab5291c57cb4e7e90b171ce98d3af5d45a2 (patch) | |
tree | 514d93391149d0fa10e488b1e4195d22e29001e2 | |
parent | 9a42480febe04f2fa1e2416310906dfab57b0cb9 (diff) | |
download | Ishtar-a54bcab5291c57cb4e7e90b171ce98d3af5d45a2.tar.bz2 Ishtar-a54bcab5291c57cb4e7e90b171ce98d3af5d45a2.zip |
Warehouse sheet: fix warehouse container stats for localisation not full
-rw-r--r-- | archaeological_finds/models_finds.py | 1 | ||||
-rw-r--r-- | archaeological_warehouse/models.py | 2 | ||||
-rw-r--r-- | archaeological_warehouse/templates/ishtar/sheet_warehouse.html | 10 |
3 files changed, 10 insertions, 3 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 882bcd811..ff173619b 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -1036,7 +1036,6 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, OwnPerms, 'excavation_id').order_by('pk').all() if base_find['excavation_id']]) - @property def materials(self): return u" ; ".join([unicode(material) diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 15d51aca1..8bd6d2944 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -150,6 +150,8 @@ class Warehouse(Address, DashboardFormItem, OwnPerms): ) res = [] old_ref = None + if not q.count(): + return [current_path] for ref in q.values('reference').order_by('reference').all(): if ref['reference'] == old_ref: continue diff --git a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html index 1b16819b6..61553b839 100644 --- a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html +++ b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html @@ -64,7 +64,10 @@ {% for items in item.number_of_finds_by_place %} <table class='table table-striped'> {% for item in items %} - <tr><th>{{item.0}}</th><td>{{item.1}}</td></tr> + <tr> + <th>{{item.0}}</th> + <td class="text-right">{{item.1}}</td> + </tr> {% endfor %} </table> {% endfor %} @@ -81,7 +84,10 @@ {% for items in item.number_of_containers_by_place %} <table class='table table-striped'> {% for item in items %} - <tr><th>{{item.0}}</th><td>{{item.1}}</td></tr> + <tr> + <th>{{item.0}}</th> + <td class="text-right">{{item.1}}</td> + </tr> {% endfor %} </table> {% endfor %} |