From 6091683c753e04b55dcdc1df6dc9bfdc26cfe087 Mon Sep 17 00:00:00 2001 From: Fabien Bourgeois Date: Thu, 15 Sep 2016 16:28:27 +0200 Subject: [PATCH] [TMP][ADD]GOLEM Activity Session Registration and link to invoice --- golem_activity_session/__openerp__.py | 3 +- .../models/golem_activity_session.py | 7 --- .../views/golem_activity_view.xml | 2 +- .../views/golem_member_view.xml | 13 ++++- .../__init__.py | 18 +++++++ .../__openerp__.py | 32 +++++++++++++ .../models/__init__.py | 18 +++++++ .../golem_activity_session_registration.py | 42 +++++++++++++++++ ...lem_activity_session_registration_view.xml | 47 +++++++++++++++++++ .../views/golem_member_view.xml | 47 +++++++++++++++++++ 10 files changed, 217 insertions(+), 12 deletions(-) create mode 100644 golem_activity_session_registration/__init__.py create mode 100644 golem_activity_session_registration/__openerp__.py create mode 100644 golem_activity_session_registration/models/__init__.py create mode 100644 golem_activity_session_registration/models/golem_activity_session_registration.py create mode 100644 golem_activity_session_registration/views/golem_activity_session_registration_view.xml create mode 100644 golem_activity_session_registration/views/golem_member_view.xml diff --git a/golem_activity_session/__openerp__.py b/golem_activity_session/__openerp__.py index b40574c..72ace2c 100644 --- a/golem_activity_session/__openerp__.py +++ b/golem_activity_session/__openerp__.py @@ -27,6 +27,5 @@ 'installable': True, 'auto_install': True, 'depends': ['product', 'mail', 'golem_activity', 'golem_member'], - 'data': ['security/ir.model.access.csv', - 'views/golem_activity_view.xml', 'views/golem_member_view.xml'] + 'data': ['security/ir.model.access.csv', 'views/golem_activity_view.xml'] } diff --git a/golem_activity_session/models/golem_activity_session.py b/golem_activity_session/models/golem_activity_session.py index b3b92c7..7780c36 100644 --- a/golem_activity_session/models/golem_activity_session.py +++ b/golem_activity_session/models/golem_activity_session.py @@ -18,13 +18,6 @@ from openerp import models, fields, api, _ -class GolemMember(models.Model): - _inherit = 'golem.member' - - activity_session_ids = fields.Many2many('golem.activity.session', - string='Activities') - - class GolemActivity(models.Model): _inherit = 'golem.activity' diff --git a/golem_activity_session/views/golem_activity_view.xml b/golem_activity_session/views/golem_activity_view.xml index 1ff393f..d5b514b 100644 --- a/golem_activity_session/views/golem_activity_view.xml +++ b/golem_activity_session/views/golem_activity_view.xml @@ -186,7 +186,7 @@ along with this program. If not, see . groups="golem_base.group_golem_user" sequence="10" /> diff --git a/golem_activity_session/views/golem_member_view.xml b/golem_activity_session/views/golem_member_view.xml index 48dd605..659d3da 100644 --- a/golem_activity_session/views/golem_member_view.xml +++ b/golem_activity_session/views/golem_member_view.xml @@ -27,8 +27,17 @@ along with this program. If not, see .

Default season activities

- + + + + + + + + + +
diff --git a/golem_activity_session_registration/__init__.py b/golem_activity_session_registration/__init__.py new file mode 100644 index 0000000..2fca3d2 --- /dev/null +++ b/golem_activity_session_registration/__init__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- + +# Copyright 2016 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 . + +from . import models diff --git a/golem_activity_session_registration/__openerp__.py b/golem_activity_session_registration/__openerp__.py new file mode 100644 index 0000000..03335b1 --- /dev/null +++ b/golem_activity_session_registration/__openerp__.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- + +# Copyright 2016 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 . + +{ + 'name': 'GOLEM Activity Session Member Registrations', + 'summary': 'GOLEM Activities Session Member Registrations management', + 'description': ''' Non-profit french MJC activities session member + registrations management ''', + 'version': '0.1', + 'category': 'GOLEM', + 'author': 'Fabien Bourgeois', + 'license': 'AGPL-3', + 'application': False, + 'installable': True, + 'depends': ['golem_activity_session', 'golem_member'], + 'data': ['views/golem_activity_session_registration_view.xml', + 'views/golem_member_view.xml'] +} diff --git a/golem_activity_session_registration/models/__init__.py b/golem_activity_session_registration/models/__init__.py new file mode 100644 index 0000000..23e71d3 --- /dev/null +++ b/golem_activity_session_registration/models/__init__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- + +# Copyright 2016 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 . + +from . import golem_activity_session_registration diff --git a/golem_activity_session_registration/models/golem_activity_session_registration.py b/golem_activity_session_registration/models/golem_activity_session_registration.py new file mode 100644 index 0000000..8004f43 --- /dev/null +++ b/golem_activity_session_registration/models/golem_activity_session_registration.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- + +# copyright 2016 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 . + +from openerp import models, fields + + +class GolemMember(models.Model): + _inherit = 'golem.member' + + activity_session_registration_ids = fields.One2many( + 'golem.activity.session.registration', 'member_id', 'Activities') + + +class GolemActivitySessionRegistration(models.Model): + _name = 'golem.activity.session.registration' + _description = 'GOLEM Activity Session Registration' + + member_id = fields.Many2one('golem.member', string='Member', required=True, + ondelete='cascade') + session_id = fields.Many2one('golem.activity.session', required=True, + string='Activity session', ondelete='cascade') + invoice_id = fields.Many2one('account.invoice', string='Invoice', + ondelete='set null') + invoice_line_id = fields.Many2one('account.invoice.line', + string='Invoice line', + ondelete='set null') + season_id = fields.Many2one(string='Season', + related='session_id.season_id') 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 new file mode 100644 index 0000000..6900585 --- /dev/null +++ b/golem_activity_session_registration/views/golem_activity_session_registration_view.xml @@ -0,0 +1,47 @@ + + + + + + + Session registration list + golem.activity.session.registration + + + + + + + + + + + + + + GOLEM Activity Session Registration List + golem.activity.session.registration + tree + + + + + diff --git a/golem_activity_session_registration/views/golem_member_view.xml b/golem_activity_session_registration/views/golem_member_view.xml new file mode 100644 index 0000000..659d3da --- /dev/null +++ b/golem_activity_session_registration/views/golem_member_view.xml @@ -0,0 +1,47 @@ + + + + + + + + Add sessions inscriptions to member form + golem.member + + + + +

Default season activities

+ + + + + + + + + + +
+
+
+
+ +
+