diff --git a/golem_activity_queue/__manifest__.py b/golem_activity_queue/__manifest__.py
index 5505045..45822e7 100644
--- a/golem_activity_queue/__manifest__.py
+++ b/golem_activity_queue/__manifest__.py
@@ -30,6 +30,7 @@
'views/golem_activity_queue_views.xml',
'views/golem_activity_views.xml',
'views/golem_member_views.xml',
- 'wizard/golem_activity_queue_choose_views.xml'
+ 'wizard/golem_activity_queue_choose_views.xml',
+ 'wizard/golem_activity_automated_queue_activate_views.xml'
]
}
diff --git a/golem_activity_queue/models/golem_activity.py b/golem_activity_queue/models/golem_activity.py
index f9bce3b..22b7df3 100644
--- a/golem_activity_queue/models/golem_activity.py
+++ b/golem_activity_queue/models/golem_activity.py
@@ -86,7 +86,18 @@ class GolemActivity(models.Model):
activity.automated_registration_from_queue = False
else:
- activity.queue_allowed = not activity.queue_allowed
+ #lancer popup pour choisir activité à s'inscrire
+ self.ensure_one()
+ activity_id = self[0]
+
+ return {
+ 'name' : _('Choose the activity to register in'),
+ 'type' : 'ir.actions.act_window',
+ 'res_model' : 'golem.activity.automated.queue.activate.wizard',
+ 'view_mode': 'form',
+ 'context' : {'default_activity_id' : activity_id.id},
+ 'target': 'new',
+ }
diff --git a/golem_activity_queue/models/golem_member.py b/golem_activity_queue/models/golem_member.py
index 0362c82..6eb68b3 100644
--- a/golem_activity_queue/models/golem_member.py
+++ b/golem_activity_queue/models/golem_member.py
@@ -125,8 +125,6 @@ class GolemMember(models.Model):
#lancer popup pour choisir activité à s'inscrire
@api.multi
def choose_queue_to_register(self):
- print "_________________________________________________"
- print self
self.ensure_one()
member_id = self[0]
diff --git a/golem_activity_queue/views/golem_activity_views.xml b/golem_activity_queue/views/golem_activity_views.xml
index 3ec0847..baacfe0 100644
--- a/golem_activity_queue/views/golem_activity_views.xml
+++ b/golem_activity_queue/views/golem_activity_views.xml
@@ -66,8 +66,7 @@ along with this program. If not, see .
+ attrs="{'invisible': [('queue_allowed', '=', True)]}"/>
.
from . import golem_activity_queue_choose
+from . import golem_activity_automated_queue_activate
diff --git a/golem_activity_queue/wizard/golem_activity_automated_queue_activate.py b/golem_activity_queue/wizard/golem_activity_automated_queue_activate.py
new file mode 100644
index 0000000..5e5d995
--- /dev/null
+++ b/golem_activity_queue/wizard/golem_activity_automated_queue_activate.py
@@ -0,0 +1,53 @@
+# -*- coding: utf-8 -*-
+
+# Copyright 2018 Youssef El Ouahby
+# Copyright 2018 Fabien Bourgeois
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+
+""" GOLEM Resources management """
+
+from odoo import models, fields, api, _
+
+class GolemActivityAutomatedQueueActivateWizard(models.TransientModel):
+ """GOLEM Activity Automated Queue wizard : Activatate automated Queue """
+ _name = "golem.activity.automated.queue.activate.wizard"
+
+ activity_id = fields.Many2one("golem.activity")
+ automated_registration_from_queue = fields.Boolean(default=True)
+
+
+ # lancer liste editable d'inscription sur attente
+ def activate_queue(self):
+ """ Activate Queue for the activity"""
+
+ self.ensure_one()
+ activation = self[0]
+ activation.activity_id.write({
+ 'queue_allowed': True,
+ 'automated_registration_from_queue': activation.automated_registration_from_queue
+ })
+
+
+ """
+ self.env['golem.activity.queue'].create({'member_id': activityQueue.member_id.id,
+ 'activity_id': activityQueue.activity_id.id})
+ message = _('the member {} is registred in queue for the activity {} with success')
+ return {
+ 'warning' : {
+ 'title' : _('Warning'),
+ 'message': (message.format(activityQueue.member_id.name,
+ activityQueue.activity_id.name))
+ }
+ }"""
diff --git a/golem_activity_queue/wizard/golem_activity_automated_queue_activate_views.xml b/golem_activity_queue/wizard/golem_activity_automated_queue_activate_views.xml
new file mode 100644
index 0000000..319b2ad
--- /dev/null
+++ b/golem_activity_queue/wizard/golem_activity_automated_queue_activate_views.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+ GOLEM Activity Automated Queue Activate Wizard Form
+ golem.activity.automated.queue.activate.wizard
+
+
+
+
+
+
+
+