diff --git a/golem_activity_queue/models/golem_activity.py b/golem_activity_queue/models/golem_activity.py
index f317df7..5036c1e 100644
--- a/golem_activity_queue/models/golem_activity.py
+++ b/golem_activity_queue/models/golem_activity.py
@@ -23,7 +23,6 @@ class GolemActivity(models.Model):
""" GOLEM Activity adaptations """
_inherit = 'golem.activity'
-
#ajout d'un champs O2M vers activity_id de golem.activity.queue
activity_queue_ids = fields.One2many('golem.activity.queue',
'activity_id', 'Pending registration')
@@ -34,12 +33,14 @@ class GolemActivity(models.Model):
#ajout d'un champs pour calculer le nombre d'inscription en file d'attente
queue_activity_number = fields.Integer(compute="_compute_queue_activity_number",
store=True, string='Pending registration number')
+ #changer le mode de basculement en cas de desinctiption
@api.multi
- def auto_registration_from_queue_toggle(self):
+ def auto_registration_toggle(self):
""" switch registration from queueu mode """
for activity in self:
activity.auto_registration_from_queue = not activity.auto_registration_from_queue
+ #supprimer les personnes en attente si une inscription directement est faite
@api.multi
def write(self, vals):
""" Override method write to delete record from queue if they register in activity"""
@@ -110,7 +111,7 @@ class GolemActivity(models.Model):
#depuis attente mode automatique
@api.multi
@api.constrains('activity_registration_ids')
- def _automatedRegistrationFromQueue(self):
+ def _auto_registration_from_queue(self):
"""automated registration from queue"""
for record in self:
# 1 verifier si une place est disponible sur activité
diff --git a/golem_activity_queue/models/golem_activity_queue.py b/golem_activity_queue/models/golem_activity_queue.py
index 7b12288..2591d56 100644
--- a/golem_activity_queue/models/golem_activity_queue.py
+++ b/golem_activity_queue/models/golem_activity_queue.py
@@ -48,7 +48,6 @@ class GolemActivityQueue(models.Model):
('queue_uniq', 'UNIQUE (member_id, activity_id)',
_('This member has already been registered for the queue.'))]
-
# decider si l'activity liée est pleine ou non : pour group by sur la liste
@api.depends('places_remain')
def _compute_is_activity_full(self):
diff --git a/golem_activity_queue/models/golem_member.py b/golem_activity_queue/models/golem_member.py
index 994f106..f80d44f 100644
--- a/golem_activity_queue/models/golem_member.py
+++ b/golem_activity_queue/models/golem_member.py
@@ -32,8 +32,10 @@ class GolemMember(models.Model):
if registrations_edited:
for registration_edited in registrations_edited:
if registration_edited[0] == 2:
- registration_removed = self.env['golem.activity.registration'].browse(registration_edited[1])
- activity_removed = self.env['golem.activity'].browse(registration_removed.activity_id.id)
+ registration_removed = self.env['golem.activity.registration'].browse(
+ registration_edited[1])
+ activity_removed = self.env['golem.activity'].browse(
+ registration_removed.activity_id.id)
if (activity_removed.queue_allowed and
activity_removed.auto_registration_from_queue and
activity_removed.queue_activity_number > 0):
@@ -83,14 +85,8 @@ class GolemMember(models.Model):
#sortir de la boucle parcourissante la queue puisque
# inscription faite
break
- elif (activity_removed.queue_allowed and
- activity_removed.queue_activity_number > 0):
- warning_message = _('There is a free place for the activity'
- ' : {}, you can fill it from the queue'
- ' using the button on queue tab')
- print warning_message.format(activity_removed.name)
return True
-
+
#verifier si nombre d'inscription sur activité est supérieur au place disponible
#inviter l'utilisateur à s'inscrire sur l'attente
@api.multi
@@ -114,7 +110,6 @@ class GolemMember(models.Model):
'message': warning_message.format(activity.name),
}
}
-
#lancer popup pour choisir activité à s'inscrire
@api.multi
def choose_queue_to_register(self):
diff --git a/golem_activity_queue/views/golem_activity_views.xml b/golem_activity_queue/views/golem_activity_views.xml
index dd47eac..5f03397 100644
--- a/golem_activity_queue/views/golem_activity_views.xml
+++ b/golem_activity_queue/views/golem_activity_views.xml
@@ -68,11 +68,11 @@ along with this program. If not, see .
string="Remove Queue" type="object"
attrs="{'invisible': [('queue_allowed', '=', False)]}"
confirm="Are you sure you want to remove queue from this activity ? This will delete all elements currently registred in"/>
-
-
diff --git a/golem_activity_queue/wizard/golem_activity_automated_queue_activate.py b/golem_activity_queue/wizard/golem_activity_automated_queue_activate.py
index 1713bce..b4f9111 100644
--- a/golem_activity_queue/wizard/golem_activity_automated_queue_activate.py
+++ b/golem_activity_queue/wizard/golem_activity_automated_queue_activate.py
@@ -27,7 +27,6 @@ class GolemActivityAutomatedQueueActivateWizard(models.TransientModel):
activity_id = fields.Many2one("golem.activity")
auto_registration_from_queue = fields.Boolean(default=True)
-
# lancer liste editable d'inscription sur attente
def activate_queue(self):
""" Activate Queue for the activity"""
diff --git a/golem_activity_queue/wizard/golem_activity_queue_choose.py b/golem_activity_queue/wizard/golem_activity_queue_choose.py
index 1e40530..e3f79bb 100644
--- a/golem_activity_queue/wizard/golem_activity_queue_choose.py
+++ b/golem_activity_queue/wizard/golem_activity_queue_choose.py
@@ -27,6 +27,7 @@ class GolemActivityQueueChooseWizard(models.TransientModel):
activity_id = fields.Many2one("golem.activity")
member_id = fields.Many2one("golem.member")
+
# lancer liste editable d'inscription sur attente
def register_in_queue(self):
""" Choisir l'activité pour s'inscrire sur sa liste d'attente"""