From ee755616bac3c343eeccd06f3b04f20538c99cff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20-=20Le=20Filament?= <remi@le-filament.com>
Date: Tue, 10 Sep 2024 18:41:28 +0200
Subject: [PATCH] [FIX] manage case where no limits

---
 views/event_registration_template.xml | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/views/event_registration_template.xml b/views/event_registration_template.xml
index 6a8f329..bf2ea6f 100644
--- a/views/event_registration_template.xml
+++ b/views/event_registration_template.xml
@@ -10,17 +10,16 @@
             expr="//t[@t-if=&quot;question.question_type == 'simple_choice'&quot;]//t[@t-as='answer']//option"
             position="attributes"
         >
-        <attribute
-                name="t-if"
-            >(answer.number_max and not answer.fully_booked) or answer.number_max == 0</attribute>
-        <attribute
-                name="t-out"
-            >answer.name + " (" + str(answer.remaining_number) + " restant(es))"</attribute>
-    </xpath>
+        <attribute name="t-if">answer.number_max == 0</attribute></xpath>
     <xpath
             expr="//t[@t-if=&quot;question.question_type == 'simple_choice'&quot;]//t[@t-as='answer']//option"
             position="after"
         >
+        <option
+                t-elif="answer.remaining_number > 0"
+                t-out="answer.name + ' (' + str(answer.remaining_number) + ' restant(es))'"
+                t-att-value="answer.id"
+            />
         <option
                 t-else=""
                 t-out="answer.name + ' (Épuisé)'"
-- 
GitLab