From 03c7ebc3d561b81e4a209c60830f77fe565a2692 Mon Sep 17 00:00:00 2001 From: eloyoussef Date: Fri, 23 Feb 2018 00:22:34 +0100 Subject: [PATCH] =?UTF-8?q?colorisation=20conditionnelle=20de=20la=20liste?= =?UTF-8?q?=20des=20attente=20+=20filtre=20activit=C3=A9=20li=C3=A9e=20ple?= =?UTF-8?q?ine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- golem_activity_queue/models/golem_activity_queue.py | 13 +++++++++++++ .../views/golem_activity_queue_views.xml | 7 ++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/golem_activity_queue/models/golem_activity_queue.py b/golem_activity_queue/models/golem_activity_queue.py index 344de07..f6758a3 100644 --- a/golem_activity_queue/models/golem_activity_queue.py +++ b/golem_activity_queue/models/golem_activity_queue.py @@ -30,7 +30,20 @@ class GolemActivityQueue(models.Model): member_id = fields.Many2one('golem.member', required=True, ondelete='cascade') is_current = fields.Boolean('Current season?', related='activity_id.is_current', store=True) + #nombre de place disponible sur activité liée + places_remain = fields.Integer(related='activity_id.places_remain') + #activité liée est plein ou non + is_activity_full = fields.Char(compute="_isActivityFull",store=True) + # decider si l'activity liée est pleine ou non + @api.multi + @api.depends('places_remain') + def _isActivityFull(self): + for record in self: + if record.places_remain <=0: + record.is_activity_full = "Full activity" + else: + record.is_activity_full = "Not full activity" def call_up_wizard(self): return { 'name': 'Are you sure?', diff --git a/golem_activity_queue/views/golem_activity_queue_views.xml b/golem_activity_queue/views/golem_activity_queue_views.xml index 1f7b420..b1dae24 100644 --- a/golem_activity_queue/views/golem_activity_queue_views.xml +++ b/golem_activity_queue/views/golem_activity_queue_views.xml @@ -51,6 +51,8 @@ along with this program. If not, see . context="{'group_by': 'member_id'}"/> + @@ -60,11 +62,14 @@ along with this program. If not, see . queue.tree golem.activity.queue - + + + +