From c49706fbb363dffa7b910e00659d7d865072066e Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 12 Feb 2025 17:44:47 +0100 Subject: 🐛 archaeological files forms: fix preventive formset equipment service (refs #6173) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archaeological_files/models.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'archaeological_files/models.py') diff --git a/archaeological_files/models.py b/archaeological_files/models.py index b45589509..26e7136b2 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -156,7 +156,15 @@ class Job(GeneralType): choices = [("", "-" * 9)] if current_value and \ current_value.pk not in [pk for pk, __ in (permanent + fixed_term)]: - choices.append((current_value.pk, str(current_value))) + if current_value.price_agreement_id == price_agreement_id: + lbl = current_value.display_label + if current_value.permanent_contract: + permanent.append((current_value.pk, lbl)) + else: + fixed_term.append((current_value.pk, lbl)) + else: + lbl = str(current_value) + choices.append((current_value.pk, lbl)) choices += [ ( _("Permanent contract"), -- cgit v1.2.3