From aa11f6d09fff9eaa8ae3394e83f73ef591967d16 Mon Sep 17 00:00:00 2001 From: Fabien Bourgeois Date: Fri, 16 Sep 2016 08:41:41 +0200 Subject: [PATCH] [ADD]GOLEM Session Registration subscription form member view to new system ok --- .../golem_activity_session_registration.py | 16 +++++++++++++- ...lem_activity_session_registration_view.xml | 21 +++++++++++++++++++ .../views/golem_member_view.xml | 18 ++++++++-------- 3 files changed, 45 insertions(+), 10 deletions(-) diff --git a/golem_activity_session_registration/models/golem_activity_session_registration.py b/golem_activity_session_registration/models/golem_activity_session_registration.py index 8004f43..3414847 100644 --- a/golem_activity_session_registration/models/golem_activity_session_registration.py +++ b/golem_activity_session_registration/models/golem_activity_session_registration.py @@ -15,7 +15,7 @@ # you should have received a copy of the gnu affero general public license # along with this program. if not, see . -from openerp import models, fields +from openerp import models, fields, api class GolemMember(models.Model): @@ -40,3 +40,17 @@ class GolemActivitySessionRegistration(models.Model): ondelete='set null') season_id = fields.Many2one(string='Season', related='session_id.season_id') + + season_default_id = fields.Many2one('golem.season', 'Default season', + compute='_compute_season_default') + + @api.one + @api.depends('session_id') + def _compute_season_default(self): + """ Compute default season """ + domain = [('is_default', '=', True)] + self.season_default_id = self.env['golem.season'].search(domain).id + # if 'default_season_id' not in self.env.context: + # ctx = self.env.context.copy() + # ctx.update({'default_season_id': self._default_season()}) + # self.with_context(ctx) diff --git a/golem_activity_session_registration/views/golem_activity_session_registration_view.xml b/golem_activity_session_registration/views/golem_activity_session_registration_view.xml index 6900585..a668b50 100644 --- a/golem_activity_session_registration/views/golem_activity_session_registration_view.xml +++ b/golem_activity_session_registration/views/golem_activity_session_registration_view.xml @@ -17,6 +17,24 @@ along with this program. If not, see . --> + + + Session registration form + golem.activity.session.registration + +
+ + + + + + + +
+
+
+ + Session registration list @@ -31,13 +49,16 @@ along with this program. If not, see . + + GOLEM Activity Session Registration List golem.activity.session.registration tree + .

Default season activities

- - - - - - - + + + + + + + -