diff options
Diffstat (limited to 'archaeological_finds/models_finds.py')
-rw-r--r-- | archaeological_finds/models_finds.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index f6c8c6bf6..d97cfd6b0 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -579,6 +579,21 @@ class FindBasket(Basket, OwnPerms): def get_query_owns(cls, ishtaruser): return Q(user=ishtaruser) + def get_extra_actions(self, request): + """ + For sheet template: return "Manage 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("select_itemsinbasket", args=[self.pk]), + _(u"Manage basket"), + "fa fa-shopping-basket", "", "", False), + ] + return actions + class FirstBaseFindView(object): CREATE_SQL = """ @@ -898,7 +913,6 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, OwnPerms, M2M_SEARCH_VECTORS = [ "datings__period__label", "object_types__label", "integrities__label", "remarkabilities__label", "material_types__label"] - objects = ExternalIdManager() QA_EDIT = QuickAction( url="find-qa-bulk-update", icon_class="fa fa-pencil", @@ -938,6 +952,7 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, OwnPerms, ('warehouse', 'container__location__pk'), ('site', 'base_finds__context_record__archaeological_site__pk') ] + objects = ExternalIdManager() # fields base_finds = models.ManyToManyField(BaseFind, verbose_name=_(u"Base find"), |