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 - + + + +