summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r--archaeological_warehouse/models.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py
index a3cbf82e3..96257da3c 100644
--- a/archaeological_warehouse/models.py
+++ b/archaeological_warehouse/models.py
@@ -33,7 +33,7 @@ from ishtar_common.models import Document, GeneralType, get_external_id, \
LightHistorizedItem, OwnPerms, Address, Person, post_save_cache, \
DashboardFormItem, ShortMenuItem, Organization, OrganizationType, \
document_attached_changed, SearchAltName, DynamicRequest, GeoItem, \
- QRCodeItem, SearchVectorConfig, DocumentItem
+ QRCodeItem, SearchVectorConfig, DocumentItem, QuickAction, MainItem
from ishtar_common.model_merging import merge_model_objects
from ishtar_common.utils import cached_label_changed, \
cached_label_and_geo_changed
@@ -51,7 +51,7 @@ post_delete.connect(post_save_cache, sender=WarehouseType)
class Warehouse(Address, DocumentItem, GeoItem, QRCodeItem, DashboardFormItem,
- OwnPerms, ShortMenuItem):
+ OwnPerms, MainItem):
SLUG = 'warehouse'
APP = "archaeological-warehouse"
MODEL = "warehouse"
@@ -86,6 +86,13 @@ class Warehouse(Address, DocumentItem, GeoItem, QRCodeItem, DashboardFormItem,
DOWN_MODEL_UPDATE = ["containers"]
CACHED_LABELS = []
+ QA_LOCK = QuickAction(
+ url="warehouse-qa-lock", icon_class="fa fa-lock",
+ text=_(u"Lock/Unlock"), target="many",
+ rights=['change_warehouse', 'change_own_warehouse']
+ )
+ QUICK_ACTIONS = [QA_LOCK]
+
objects = ExternalIdManager()
name = models.CharField(_(u"Name"), max_length=200)
@@ -411,7 +418,7 @@ post_delete.connect(post_save_cache, sender=ContainerType)
class Container(DocumentItem, LightHistorizedItem, QRCodeItem, GeoItem,
- OwnPerms):
+ OwnPerms, MainItem):
SLUG = 'container'
APP = "archaeological-warehouse"
MODEL = "container"
@@ -578,6 +585,13 @@ class Container(DocumentItem, LightHistorizedItem, QRCodeItem, GeoItem,
),
}
+ QA_LOCK = QuickAction(
+ url="container-qa-lock", icon_class="fa fa-lock",
+ text=_(u"Lock/Unlock"), target="many",
+ rights=['change_container', 'change_own_container']
+ )
+ QUICK_ACTIONS = [QA_LOCK]
+
objects = ExternalIdManager()
# fields