From c670aef943774a8ecdde2c42ced75f0049bec7ed Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 18 Oct 2018 14:58:09 +0200 Subject: Manage QA on sheet - QA basket on find sheet --- archaeological_finds/models_finds.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'archaeological_finds/models_finds.py') diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 3a1d44f36..9a1412917 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -1134,6 +1134,26 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, OwnPerms, return "00" return bf.short_id() + def get_extra_actions(self, request): + """ + For sheet template: return "Add to basket" action + """ + # url, base_text, icon, extra_text, extra css class, is a quick action + + # no particular rights: if you can view an itm you can add it to your + # own basket + actions = [ + ( + reverse("find-qa-basket", args=[self.pk]), + _(u"Add to basket"), + "fa fa-shopping-basket", + "", + "", + True + ) + ] + return actions + def _get_base_image_path(self): bf = None if self.id: -- cgit v1.2.3