From 225f4356ca145d7f634aa8050d936de2dbd1cfec Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 25 Nov 2024 17:34:36 +0100 Subject: 🐛 fix associated basket for treatment requests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archaeological_finds/models_finds.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'archaeological_finds/models_finds.py') diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 93a3286bc..4c410f668 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -2848,7 +2848,9 @@ class Find( def associated_treatment_files(self): TreatmentFile = apps.get_model("archaeological_finds", "TreatmentFile") return TreatmentFile.objects.filter( - associated_basket__items__pk=self.pk + associated_basket_id__in=FindBasket.objects.filter( + items__pk=self.pk + ).values_list("pk", flat=True) ).order_by("reception_date", "creation_date", "end_date") def associated_treatment_files_count(self): -- cgit v1.2.3