diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-10-19 14:18:30 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-10-24 12:06:09 +0200 |
| commit | 488d9c2a72142dbaed66cb11ae8a9629ea6fe923 (patch) | |
| tree | 29f92a2c4caff32bb80907da9d659211f9291e1b /archaeological_finds/models_finds.py | |
| parent | bef385bdb038c6f4f00ca8ba176c8f3d4ef5c5ed (diff) | |
| download | Ishtar-488d9c2a72142dbaed66cb11ae8a9629ea6fe923.tar.bz2 Ishtar-488d9c2a72142dbaed66cb11ae8a9629ea6fe923.zip | |
Manage find basket modification wizard
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"), |
