From dd22f90b248ba60b7d247d8a06eedf56c84b955a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 19 Sep 2018 16:00:58 +0200 Subject: Warehouse sheet: fix container list (refs #4240) --- archaeological_warehouse/forms.py | 5 +++-- archaeological_warehouse/models.py | 4 ++-- archaeological_warehouse/templates/ishtar/sheet_warehouse.html | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'archaeological_warehouse') diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index 57992c7e2..954c01918 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -254,8 +254,9 @@ class ContainerSelect(TableSelect): label=_(u"Full text search"), widget=widgets.SearchWidget( 'archaeological-warehouse', 'container' )) - location = get_warehouse_field(label=_(u"Current location (warehouse)")) - responsible = get_warehouse_field(label=_(u"Responsible warehouse")) + location_name = get_warehouse_field( + label=_(u"Current location (warehouse)")) + responsible_name = get_warehouse_field(label=_(u"Responsible warehouse")) container_type = forms.ChoiceField(label=_(u"Container type"), choices=[]) reference = forms.CharField(label=_(u"Ref.")) diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 1637bc8eb..cf7313ba5 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -332,11 +332,11 @@ class Container(LightHistorizedItem, ImageModel): # alternative names of fields for searches ALT_NAMES = { - 'location': ( + 'location_name': ( pgettext_lazy("key for text search", u"location"), 'location__name__iexact' ), - 'responsible': ( + 'responsible_name': ( pgettext_lazy("key for text search", u"responsible-warehouse"), 'responsible__name__iexact' ), diff --git a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html index b3446c15a..ae032a8a4 100644 --- a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html +++ b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html @@ -40,12 +40,12 @@ {% if item.containers.count %}

{% trans "Containers" %}

-{% dynamic_table_document '' 'containers' 'location' item.pk 'TABLE_COLS' output %} +{% dynamic_table_document '' 'containers' 'location_id' item.pk 'TABLE_COLS' output %} {% endif %} {% if item.owned_containers.count %}

{% trans "Attached containers" %}

-{% dynamic_table_document '' 'containers' 'responsible' item.pk 'TABLE_COLS' output %} +{% dynamic_table_document '' 'containers' 'responsible_id' item.pk 'TABLE_COLS' output %} {% endif %}

{% trans "Statistics" %}

-- cgit v1.2.3