From e538b5e3629c40e2a04dc354209fbae86ee07cf0 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 9 Sep 2020 12:52:27 +0200 Subject: Sheet warehouse: display find inside/owned by the warehouse --- archaeological_finds/models_finds.py | 2 +- .../templates/ishtar/sheet_warehouse.html | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index b893951b7..2faf97d1d 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -937,7 +937,7 @@ class Find(BulkUpdatedItem, ValueGetter, DocumentItem, BaseHistorizedItem, 'cached_label': 'cached_label__icontains', 'documents__image__isnull': 'documents__image__isnull', 'container__location': 'container__location__pk', - 'container__responsible': 'container__responsible__pk', + 'container_ref__location': 'container_ref__location__pk', } for table in (TABLE_COLS, TABLE_COLS_FOR_OPE): for key in table: diff --git a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html index 1307425ff..dcaa12215 100644 --- a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html +++ b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html @@ -96,6 +96,24 @@ {% trans "No container inside this warehouse" %} {% endif %} + {% if item.number_of_finds_hosted %} +

{% trans "Finds (hosted)" %}

+ {% dynamic_table_document '' 'finds' 'container__location' item.pk 'TABLE_COLS' output %} + {% else %} +
+ + {% trans "No find inside this warehouse" %} +
+ {% endif %} + {% if item.number_of_finds %} +

{% trans "Finds (owned)" %}

+ {% dynamic_table_document '' 'finds' 'container_ref__location' item.pk 'TABLE_COLS' output %} + {% else %} +
+ + {% trans "No find owned by this warehouse" %} +
+ {% endif %}