From 07dc587a9441033d48ec17a28d2cfac5fb6b8fbe Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 3 Dec 2018 17:14:13 +0100 Subject: Sheet operation QA: add context record --- archaeological_operations/models.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'archaeological_operations/models.py') diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index b15dbf580..a0d0ba30b 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -1064,6 +1064,22 @@ class Operation(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter, finds__base_finds__context_record__operation=self ) + def get_extra_actions(self, request): + """ + For sheet template + """ + # url, base_text, icon, extra_text, extra css class, is a quick action + + can_add_cr = self.can_do(request, 'add_contextrecord') + actions = [] + if can_add_cr: + actions += [ + (reverse('operation-qa-contextrecord', args=[self.pk]), + _(u"Add context record"), "fa fa-plus", + _(u"context record"), "", True), + ] + return actions + associated_file_short_label_lbl = _(u"Archaeological file") full_code_patriarche_lbl = _(u"Code patriarche") -- cgit v1.2.3