summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archaeological_operations/models.py6
-rw-r--r--archaeological_operations/templates/ishtar/sheet_operation.html17
2 files changed, 17 insertions, 6 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index 727b29cb5..e741f5644 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -507,6 +507,12 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms,
return FindSource.objects.filter(
find__base_finds__context_record__operation=self)
+ def containers_q(self):
+ from archaeological_warehouse.models import Container
+ return Container.objects.filter(
+ finds__base_finds__context_record__operation=self
+ )
+
associated_file_short_label_lbl = _(u"Archaeological file")
full_code_patriarche_lbl = _(u"Code patriarche")
diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html
index e920dd226..48116433c 100644
--- a/archaeological_operations/templates/ishtar/sheet_operation.html
+++ b/archaeological_operations/templates/ishtar/sheet_operation.html
@@ -111,30 +111,35 @@
{% endif %}
{% if item.context_record.count %}
-<h3>{% trans "Context records" %}</h3>
-{% dynamic_table_document '' 'context_records_for_ope' 'operation' item.pk 'TABLE_COLS_FOR_OPE' output %}
+{% trans "Context records" as cr_lab %}
+{% dynamic_table_document cr_lab 'context_records_for_ope' 'operation' item.pk 'TABLE_COLS_FOR_OPE' output %}
{% endif %}
-{% trans "Context record relations" as cr_rels %}
{% if item.context_record_relations_q.count %}
+{% trans "Context record relations" as cr_rels %}
{% dynamic_table_document cr_rels 'context_records_relations_detail' 'left_record__operation' item.pk '' output %}
{% endif %}
-{% trans "Documents from associated context records" as cr_docs %}
{% if item.context_record_docs_q.count %}
+{% trans "Documents from associated context records" as cr_docs %}
{% dynamic_table_document cr_docs 'context_records_docs' 'context_record__operation' item.pk '' output %}
{% endif %}
-{% trans "Finds" as finds %}
{% if item.finds %}
+{% trans "Finds" as finds %}
{% dynamic_table_document finds 'finds_for_ope' 'base_finds__context_record__operation' item.pk 'TABLE_COLS_FOR_OPE' output %}
{% endif %}
-{% trans "Documents from associated finds" as finds_docs %}
{% if item.find_docs_q.count %}
+{% trans "Documents from associated finds" as finds_docs %}
{% dynamic_table_document finds_docs 'finds_docs' 'find__base_finds__context_record__operation' item.pk '' output %}
{% endif %}
+{% if item.containers_q.count %}
+{% trans "Associated containers" as containers_lbl %}
+{% dynamic_table_document containers_lbl 'containers' 'finds__base_finds__context_record__operation' item.pk '' output %}
+{% endif %}
+
<h3>{% trans "Statistics" %}</h3>
<h4>{% trans "Administrative acts" %}</h4>