diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2023-03-08 13:00:40 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2023-03-08 13:00:40 +0100 |
commit | 5ec494564251e27e3f802e6c1aec3c6aa1890488 (patch) | |
tree | bbaa2a0f15ea7552672f6ec9c4a5fa03c487420f /archaeological_operations/models.py | |
parent | f447bbebea851eb7014815351dc69e03d0aff47f (diff) | |
download | Ishtar-5ec494564251e27e3f802e6c1aec3c6aa1890488.tar.bz2 Ishtar-5ec494564251e27e3f802e6c1aec3c6aa1890488.zip |
Site: quick action for creation of virtual operation from site with many operations (refs #3935)
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r-- | archaeological_operations/models.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index a7a9823b8..091e1e60c 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -619,6 +619,19 @@ class ArchaeologicalSite( if can_add_geo: actions.append(self.get_add_geo_action()) + can_create_operation = self.can_do(request, "change_operation") + if can_create_operation and self.operations.count(): + actions.append( + ( + reverse("site-qa-top-operation", args=[self.pk]), + _("Create a cluster operation for site associated to many operations"), + "fa fa-plus", + _("top ope."), + "", + False + ) + ) + can_edit_site = self.can_do(request, "change_archaeologicalsite") if can_edit_site: actions += [ @@ -797,6 +810,7 @@ class ArchaeologicalSite( right_record=value, relation_type=rel_type, ) + return top_operation def site_post_save(sender, **kwargs): |