From 9a933515d0a263a077b96cf2a0517f6e6b2be314 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 17 Dec 2021 11:38:49 +0100 Subject: Find - Quick action n1 treatment: add redirect in table quick action - fix resulting_pk initialization (refs #5231) --- ishtar_common/models_common.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'ishtar_common/models_common.py') diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index 0d8eeac54..83955ab73 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -2701,7 +2701,14 @@ class QuickAction: """ def __init__( - self, url, icon_class="", text="", target=None, rights=None, module=None + self, + url, + icon_class="", + text="", + target=None, + rights=None, + module=None, + is_popup=True, ): self.url = url self.icon_class = icon_class @@ -2709,6 +2716,7 @@ class QuickAction: self.rights = rights self.target = target self.module = module + self.is_popup = is_popup assert self.target in ("one", "many", None) def is_available(self, user, session=None, obj=None): @@ -3255,8 +3263,13 @@ class ShortMenuItem: class SerializeItem: SERIALIZE_EXCLUDE = ["search_vector"] - SERIALIZE_PROPERTIES = ["external_id", "multi_polygon_geojson", "point_2d_geojson", - "images_number", "json_sections"] + SERIALIZE_PROPERTIES = [ + "external_id", + "multi_polygon_geojson", + "point_2d_geojson", + "images_number", + "json_sections", + ] SERIALIZE_CALL = {} SERIALIZE_DATES = [] SERIALIZATION_FILES = [] @@ -3284,7 +3297,7 @@ class SerializeItem: and hasattr(value, "full_serialize") and not recursion ): - #print(field.name, self.__class__, self) + # print(field.name, self.__class__, self) value = value.full_serialize(recursion=True) elif field_name in self.SERIALIZATION_FILES: try: @@ -3305,7 +3318,7 @@ class SerializeItem: and hasattr(first_value, "full_serialize") and not recursion ): - #print(field.name, self.__class__, self) + # print(field.name, self.__class__, self) values = [ v.full_serialize(recursion=True) for v in values.all() ] @@ -3400,6 +3413,7 @@ class MainItem(ShortMenuItem, SerializeItem): mark_safe(action.text), mark_safe(action.rendered_icon), action.target or "", + action.is_popup, ] ) return qas -- cgit v1.2.3