diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-01-28 17:17:29 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-01-28 17:20:17 +0100 |
commit | ddc9e839ff1c185801ba922542b468a015c76767 (patch) | |
tree | 12993153d8c847e294d736a968461c6cfb57faa8 /archaeological_warehouse | |
parent | 1c9ba2417ba3ba511bc392654179cf1a8460356d (diff) | |
download | Ishtar-ddc9e839ff1c185801ba922542b468a015c76767.tar.bz2 Ishtar-ddc9e839ff1c185801ba922542b468a015c76767.zip |
🚑️ sheet warehouse: deactivate statistics when too many containers are attached
Diffstat (limited to 'archaeological_warehouse')
-rw-r--r-- | archaeological_warehouse/models.py | 1 | ||||
-rw-r--r-- | archaeological_warehouse/templates/ishtar/sheet_warehouse.html | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 67af4b5e0..3cb04816d 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -220,6 +220,7 @@ class DivisionContainer(DashboardFormItem): def _number_of_items_by_place(self, model, division_key, count_filter=None): res = {} + # TODO v5: optimize cf. Les Milles DRASSM paths = self.available_division_tuples[:] for path in paths: cpath = [] diff --git a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html index d82b0ee6c..76a419e78 100644 --- a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html +++ b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html @@ -171,6 +171,12 @@ role="tabpanel" aria-labelledby="{{window_id}}-stats-tab"> <h3>{% trans "Statistics" %}</h3> + {% if item.number_containers > 1000 or item.number_divisions > 200 %} + <div class="alert alert-info"> + <i class="fa fa-exclamation-triangle"></i> + <em>{% trans "Statistics disabled when too many containers are attached to a warehouse. In a future version, statistics will be optimized." %}</em> + </div> + {% else %} <div class="row mt-2 mb-2"> <div class="col"> <div class="btn-group btn-group-sm" role="group" @@ -247,6 +253,7 @@ {% endfor %} {% endif %} + {% endif %} </div> {% if display_documents %} <div class="tab-pane fade" id="{{window_id}}-documents" |