diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-09-10 20:49:13 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-09-10 20:49:13 +0200 |
commit | 3dae10a792d49d685debfe52eb7d61b9a6dc93f9 (patch) | |
tree | 45f1d910b67a30e44015735581ec9cdc6db51cdf /archaeological_warehouse/models.py | |
parent | 58178a04b3e716a063b1c457018aafe28e5107dd (diff) | |
download | Ishtar-3dae10a792d49d685debfe52eb7d61b9a6dc93f9.tar.bz2 Ishtar-3dae10a792d49d685debfe52eb7d61b9a6dc93f9.zip |
QA: lock/unlock (sites, operations, context records, finds, containers, warehouses)
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r-- | archaeological_warehouse/models.py | 20 |
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 |