diff options
Diffstat (limited to 'archaeological_finds/models_finds.py')
| -rw-r--r-- | archaeological_finds/models_finds.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index b79c21c69..5eed32772 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -2711,7 +2711,7 @@ class Find( return lst def m2m_listing_datings(self) -> list: - return [dating.full_serialize() for dating in self.datings.all()] + return [dating.full_serialize(keep_id=True) for dating in self.datings.all()] DOC_VALUES = [ ("base_finds", _("List of associated base finds")), @@ -2851,12 +2851,23 @@ class Find( is_locked = hasattr(self, "is_locked") and self.is_locked(request.user) profile = get_current_profile() + can_edit_find = self.can_do(request, "archaeological_finds.change_find") + if can_edit_find and not is_locked: + actions += [ + ( + reverse("find-dating-add", args=[self.pk]), + _("Add period"), + "fa fa-plus", + _("period"), + "", + True, + ), + ] can_add_geo = profile.mapping and self.can_do(request, "ishtar_common.add_geovectordata") if can_add_geo: if self.base_finds.count() == 1: actions.append(self.base_finds.all()[0].get_add_geo_action()) - can_edit_find = self.can_do(request, "archaeological_finds.change_find") if can_edit_find and not is_locked: actions += [ ( |
