From 3dae10a792d49d685debfe52eb7d61b9a6dc93f9 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 10 Sep 2019 20:49:13 +0200 Subject: QA: lock/unlock (sites, operations, context records, finds, containers, warehouses) --- archaeological_context_records/models.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'archaeological_context_records/models.py') diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 875a48019..dc8409b39 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -33,14 +33,13 @@ from django.utils.text import slugify from ishtar_common.utils import cached_label_changed, \ m2m_historization_changed, post_save_geo -from ishtar_common.model_managers import ExternalIdManager from ishtar_common.models import Document, GeneralType, \ BaseHistorizedItem, HistoricalRecords, OwnPerms, ShortMenuItem, \ GeneralRelationType, GeneralRecordRelations, post_delete_record_relation,\ post_save_cache, ValueGetter, BulkUpdatedItem, \ RelationItem, Town, get_current_profile, document_attached_changed, \ HistoryModel, SearchAltName, GeoItem, QRCodeItem, SearchVectorConfig, \ - DocumentItem + DocumentItem, MainItem, QuickAction from archaeological_operations.models import Operation, Period, Parcel, \ ArchaeologicalSite from ishtar_common.model_managers import UUIDModelManager @@ -292,7 +291,7 @@ class CRBulkView(object): class ContextRecord(BulkUpdatedItem, DocumentItem, BaseHistorizedItem, - QRCodeItem, GeoItem, OwnPerms, ValueGetter, ShortMenuItem, + QRCodeItem, GeoItem, OwnPerms, ValueGetter, MainItem, RelationItem): SLUG = 'contextrecord' APP = "archaeological-context-records" @@ -452,6 +451,15 @@ class ContextRecord(BulkUpdatedItem, DocumentItem, BaseHistorizedItem, "cached_related_context_records"] DOWN_MODEL_UPDATE = ["base_finds"] + QA_LOCK = QuickAction( + url="contextrecord-qa-lock", icon_class="fa fa-lock", + text=_(u"Lock/Unlock"), target="many", + rights=['change_contextrecord', 'change_own_contextrecord'] + ) + QUICK_ACTIONS = [ + QA_LOCK + ] + history = HistoricalRecords(bases=[HistoryModel]) objects = UUIDModelManager() -- cgit v1.2.3