From cdefa64770c7572ea0002d5444c31834fe69e054 Mon Sep 17 00:00:00 2001 From: youssef Date: Mon, 17 Sep 2018 13:47:14 +0100 Subject: [PATCH 01/69] Create pcs data --- golem_pcs/data/golem_pcs_data.xml | 281 ++++++++++++++++++++++++++++++ 1 file changed, 281 insertions(+) create mode 100644 golem_pcs/data/golem_pcs_data.xml diff --git a/golem_pcs/data/golem_pcs_data.xml b/golem_pcs/data/golem_pcs_data.xml new file mode 100644 index 0000000..2378cb3 --- /dev/null +++ b/golem_pcs/data/golem_pcs_data.xml @@ -0,0 +1,281 @@ + + + + + + + + + + Agriculteurs exploitants + 1 + + + Artisans, commerçants et chefs d’entreprise + 2 + + + Cadres et professions intellectuelles supérieures + 3 + + + Professions intermédiaires + 4 + + + Employés + 5 + + + Ouvriers + 6 + + + Retraités + 7 + + + Retraités + 7 + + + Autres personnes sans activité professionnelle + 8 + + + + + Agriculteurs sur petite exploitation + 11 + + + + Agriculteurs sur moyenne exploitation + 12 + + + + Agriculteurs sur grande exploitation + 13 + + + + + Artisan + 21 + + + + Commerçant et assimilés + 22 + + + + Chefs d’entreprise de 10 salariés ou plus + 23 + + + + + Professions libérales + 31 + + + + Cadres de la fonction publique + 33 + + + + Professeurs, professions scientifiques + 34 + + + + Professions de l’information, des arts et des spectacles + 35 + + + + Cadres administratifs et commerciaux d’entreprise + 37 + + + + Ingénieurs et cadres techniques d’entreprise + 38 + + + + + Professeurs des écoles, instituteurs et assimilés + 42 + + + + Professions intermédiaires de la santé et du travail social + 43 + + + + Clergé, religieux + 44 + + + + Professions intermédiaires administratives de la fonction publique + 45 + + + + Professions intermédiaires administratives et commerciales des entreprises + 46 + + + + Techniciens + 47 + + + + Contremaîtres, agents de maîtrise + 48 + + + + + Employés civils et agents de service de la fonction publique + 52 + + + + Policiers et militaires + 53 + + + + Employés administratifs d’entreprise + 54 + + + + Employés de commerce + 55 + + + + Personnels des services directs aux particuliers + 56 + + + + + Ouvriers qualifiés de type industriel + 62 + + + + Ouvriers qualifiés de type artisanal + 63 + + + + Chauffeurs + 64 + + + + Ouvriers qualifiés de la manutention, du magasinage et du transport + 65 + + + + Ouvriers non qualifiés de type industriel + 67 + + + + Ouvriers non qualifiés de type artisanal + 68 + + + + Ouvriers agricoles + 69 + + + + + Anciens agriculteurs exploitants + 71 + + + + Anciens artisans, commerçants et chefs d’entreprise + 72 + + + + Anciens cadres + 74 + + + + Anciennes professions intermédiaires + 75 + + + + Anciens employés + 77 + + + + Anciens ouvriers + 78 + + + + + Chômeurs n’ayant jamais travaillé + 81 + + + + Militaires du contingent + 83 + + + + Élèves, étudiants + 84 + + + + Personnes diverses sans activité professionnelle de moins de 60 ans (sauf retraités) + 85 + + + + Personnes diverses sans activité professionnelle de 60 ans et plus (sauf retraités) + 86 + + + + From 656ffd6aa2e3ccd87ec2be8f7f3d5d7e07e57eba Mon Sep 17 00:00:00 2001 From: youssef Date: Mon, 17 Sep 2018 13:47:37 +0100 Subject: [PATCH 02/69] Create golem.pcs --- golem_pcs/models/golem_pcs.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 golem_pcs/models/golem_pcs.py diff --git a/golem_pcs/models/golem_pcs.py b/golem_pcs/models/golem_pcs.py new file mode 100644 index 0000000..52f9ccf --- /dev/null +++ b/golem_pcs/models/golem_pcs.py @@ -0,0 +1,29 @@ +# -*- 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 PCS """ + +from odoo import models, fields, api, _ + +class GolemPCS(models.Model): + """ GOLEM PCS """ + _name = 'golem.pcs' + + name = fields.Char(required=True, index=True) + code = fields.Char() + parent_id = fields.Many2one('golem.pcs', ondelete='cascade', index=True) From fb626e4885e68bb02582cc22805e64fa357ac2ed Mon Sep 17 00:00:00 2001 From: youssef Date: Mon, 17 Sep 2018 13:47:57 +0100 Subject: [PATCH 03/69] Add pcs_id to golem.member --- golem_pcs/models/golem_member.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 golem_pcs/models/golem_member.py diff --git a/golem_pcs/models/golem_member.py b/golem_pcs/models/golem_member.py new file mode 100644 index 0000000..c5e586c --- /dev/null +++ b/golem_pcs/models/golem_member.py @@ -0,0 +1,28 @@ +# -*- 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 Member adaptations """ + +from odoo import models, fields, api, _ + +class GolemMember(models.Model): + """ GOLEM Member extention """ + _inherit = 'golem.member' + + pcs_id = fields.Many2one('golem.pcs', string='Professions and Socioprofessional Categories', + domain="[('parent_id', '!=', False)]") From 6949825e01de59a229d60c7a6fdddb7f6908304e Mon Sep 17 00:00:00 2001 From: youssef Date: Mon, 17 Sep 2018 13:48:16 +0100 Subject: [PATCH 04/69] Create models/init --- golem_pcs/models/__init__.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 golem_pcs/models/__init__.py diff --git a/golem_pcs/models/__init__.py b/golem_pcs/models/__init__.py new file mode 100644 index 0000000..2f1f33a --- /dev/null +++ b/golem_pcs/models/__init__.py @@ -0,0 +1,19 @@ +# -*- 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 . + +from . import golem_member, golem_pcs From fdf95b6aa56245f614aeed84e235132e8145ed84 Mon Sep 17 00:00:00 2001 From: youssef Date: Mon, 17 Sep 2018 13:48:33 +0100 Subject: [PATCH 05/69] Create member_views --- golem_pcs/views/golem_member_views.xml | 50 ++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 golem_pcs/views/golem_member_views.xml diff --git a/golem_pcs/views/golem_member_views.xml b/golem_pcs/views/golem_member_views.xml new file mode 100644 index 0000000..2d4957e --- /dev/null +++ b/golem_pcs/views/golem_member_views.xml @@ -0,0 +1,50 @@ + + + + + + + + + + GOLEM Member Form PCS adaptations + golem.member + + + + + + + + + + GOLEM Member Search PCS adaptations + golem.member + + + + + + + + + + + + From a4ae56277aa49fc441fa17a31615fc2c24056102 Mon Sep 17 00:00:00 2001 From: youssef Date: Mon, 17 Sep 2018 13:49:02 +0100 Subject: [PATCH 06/69] Create init --- golem_pcs/__init__.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 golem_pcs/__init__.py diff --git a/golem_pcs/__init__.py b/golem_pcs/__init__.py new file mode 100644 index 0000000..1fced20 --- /dev/null +++ b/golem_pcs/__init__.py @@ -0,0 +1,19 @@ +# -*- 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 . + +from . import models From 4e33afff0bf5d3143bfbd8a65059b4c269b8dbb6 Mon Sep 17 00:00:00 2001 From: youssef Date: Mon, 17 Sep 2018 13:49:15 +0100 Subject: [PATCH 07/69] Create manifest --- golem_pcs/__manifest__.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 golem_pcs/__manifest__.py diff --git a/golem_pcs/__manifest__.py b/golem_pcs/__manifest__.py new file mode 100644 index 0000000..a513241 --- /dev/null +++ b/golem_pcs/__manifest__.py @@ -0,0 +1,31 @@ +# -*- 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 . + +{ + 'name': 'GOLEM Professions and Socioprofessional Categories', + 'summary': 'GOLEM Professions and Socioprofessional Categories', + 'version': '10.0.0.2.0', + 'category': 'GOLEM', + 'author': 'Fabien Bourgeois, Youssef El ouahby', + 'license': 'AGPL-3', + 'application': False, + 'installable': True, + 'depends': ['golem_member'], + 'data': ['views/golem_member_views.xml', + 'data/golem_pcs_data.xml'] +} From c1116fa129d2d33b8e2fd94fa6009bbda10f639b Mon Sep 17 00:00:00 2001 From: youssef Date: Wed, 19 Sep 2018 13:07:00 +0100 Subject: [PATCH 08/69] Create __manifest__ --- .../__manifest__.py | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 golem_activity_limite_registration/__manifest__.py diff --git a/golem_activity_limite_registration/__manifest__.py b/golem_activity_limite_registration/__manifest__.py new file mode 100644 index 0000000..8c0d8ab --- /dev/null +++ b/golem_activity_limite_registration/__manifest__.py @@ -0,0 +1,31 @@ +# -*- 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 . + +{ + 'name': 'GOLEM activity limite registration', + 'summary': 'GOLEM activity limite registration', + 'description': ''' GOLEM activity limite registration ''', + 'version': '10.0.0.0.1', + 'category': 'GOLEM', + 'author': 'Youssef El Ouahby, Fabien Bourgeois', + 'license': 'AGPL-3', + 'application': True, + 'installable': True, + 'depends': ['golem_activity', 'golem_activity_registration'], + 'data': ['views/golem_activity_views.xml'] +} From fdbae8aa3be95c19797659710cd1c9c88f63a7d6 Mon Sep 17 00:00:00 2001 From: youssef Date: Wed, 19 Sep 2018 13:07:15 +0100 Subject: [PATCH 09/69] Create __init__ --- .../__init__.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 golem_activity_limite_registration/__init__.py diff --git a/golem_activity_limite_registration/__init__.py b/golem_activity_limite_registration/__init__.py new file mode 100644 index 0000000..1fced20 --- /dev/null +++ b/golem_activity_limite_registration/__init__.py @@ -0,0 +1,19 @@ +# -*- 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 . + +from . import models From 2720d500996b48affe691fa60a5b2ed278fefb63 Mon Sep 17 00:00:00 2001 From: youssef Date: Wed, 19 Sep 2018 13:07:39 +0100 Subject: [PATCH 10/69] Edit activity views --- .../views/golem_activity_views.xml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 golem_activity_limite_registration/views/golem_activity_views.xml diff --git a/golem_activity_limite_registration/views/golem_activity_views.xml b/golem_activity_limite_registration/views/golem_activity_views.xml new file mode 100644 index 0000000..543a666 --- /dev/null +++ b/golem_activity_limite_registration/views/golem_activity_views.xml @@ -0,0 +1,46 @@ + + + + + + + + Golem Activity Form Limite Registration Adapations + golem.activity + + + + + + + + + Golem Activity Search Limite Registration Adapations + golem.activity + + + + + + + + + From ab3c97143eacf6a8eb26845cdd76db217fb4a00a Mon Sep 17 00:00:00 2001 From: youssef Date: Wed, 19 Sep 2018 13:08:07 +0100 Subject: [PATCH 11/69] Edit activity model --- .../models/golem_activity.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 golem_activity_limite_registration/models/golem_activity.py diff --git a/golem_activity_limite_registration/models/golem_activity.py b/golem_activity_limite_registration/models/golem_activity.py new file mode 100644 index 0000000..999b543 --- /dev/null +++ b/golem_activity_limite_registration/models/golem_activity.py @@ -0,0 +1,27 @@ +# -*- 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 Activity adaptations """ + +from odoo import models, fields, api, _ + +class GolemActivity(models.Model): + """ GOLEM Activity adaptations """ + _inherit = 'golem.activity' + + only_for_subscriber = fields.Boolean(required=True) From 6dd9652dc1731cbdf18ed6d7c06f8995ec129c63 Mon Sep 17 00:00:00 2001 From: youssef Date: Wed, 19 Sep 2018 13:08:30 +0100 Subject: [PATCH 12/69] Edit activity registration model --- .../models/golem_activity_registration.py | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 golem_activity_limite_registration/models/golem_activity_registration.py diff --git a/golem_activity_limite_registration/models/golem_activity_registration.py b/golem_activity_limite_registration/models/golem_activity_registration.py new file mode 100644 index 0000000..1da353b --- /dev/null +++ b/golem_activity_limite_registration/models/golem_activity_registration.py @@ -0,0 +1,35 @@ +# -*- 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 Activity Registration """ + +from odoo import models, fields, api, _ + +class GolemActivityRegistration(models.Model): + """ GOLEM Activity Registration """ + _inherit = 'golem.activity.registration' + + @api.constrains('member_id') + def _check_member_reliability(self): + """ Forbid registration when user doesn't have a valide membership """ + for reg in self: + if reg.activity_id.only_for_subscriber: + if reg.member_id.membership_state in ['none', 'canceled', 'old']: + emsg = _('Subscription can not be executed : the targeted ' + 'activity is only for subscriber.') + raise models.ValidationError(emsg) From 20919252d1fab9fbdddf700d76ddc2d641d9ce34 Mon Sep 17 00:00:00 2001 From: youssef Date: Wed, 19 Sep 2018 13:08:47 +0100 Subject: [PATCH 13/69] Create models __init__ --- .../models/__init__.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 golem_activity_limite_registration/models/__init__.py diff --git a/golem_activity_limite_registration/models/__init__.py b/golem_activity_limite_registration/models/__init__.py new file mode 100644 index 0000000..56a42c2 --- /dev/null +++ b/golem_activity_limite_registration/models/__init__.py @@ -0,0 +1,19 @@ +# -*- 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 . + +from . import golem_activity, golem_activity_registration From 2c9e7f2442437faba90e640b5e17dd4fc9b254fd Mon Sep 17 00:00:00 2001 From: youssef Date: Wed, 19 Sep 2018 16:51:46 +0100 Subject: [PATCH 14/69] Add free_activity field to activity --- .../models/golem_activity.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 golem_activity_registration_payment/models/golem_activity.py diff --git a/golem_activity_registration_payment/models/golem_activity.py b/golem_activity_registration_payment/models/golem_activity.py new file mode 100644 index 0000000..71acdb6 --- /dev/null +++ b/golem_activity_registration_payment/models/golem_activity.py @@ -0,0 +1,27 @@ +# -*- 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 Activity adaptations """ + +from odoo import models, fields + +class GolemActivity(models.Model): + """ GOLEM Activity adaptations """ + _inherit = 'golem.activity' + + free_activity = fields.Boolean(required=True) From 0924ac6437cf36ac927b5fd39eabe69da347294b Mon Sep 17 00:00:00 2001 From: youssef Date: Wed, 19 Sep 2018 16:52:28 +0100 Subject: [PATCH 15/69] Edit __manifest__ --- golem_activity_registration_payment/__manifest__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/golem_activity_registration_payment/__manifest__.py b/golem_activity_registration_payment/__manifest__.py index 10a4df5..87325cc 100644 --- a/golem_activity_registration_payment/__manifest__.py +++ b/golem_activity_registration_payment/__manifest__.py @@ -29,5 +29,6 @@ 'data': ['views/golem_member_views.xml', 'views/golem_activity_registration_views.xml', 'report/golem_member_card_templates.xml', - 'wizard/golem_activity_registration_invoicing.xml'] + 'wizard/golem_activity_registration_invoicing.xml', + 'views/golem_activity_views.xml'] } From 85a734f9c20a80474dab14201ca4f9a9e28ebd52 Mon Sep 17 00:00:00 2001 From: youssef Date: Wed, 19 Sep 2018 16:53:04 +0100 Subject: [PATCH 16/69] Add free_activity field and filter to activity views --- .../views/golem_activity_views.xml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 golem_activity_registration_payment/views/golem_activity_views.xml diff --git a/golem_activity_registration_payment/views/golem_activity_views.xml b/golem_activity_registration_payment/views/golem_activity_views.xml new file mode 100644 index 0000000..1ee833a --- /dev/null +++ b/golem_activity_registration_payment/views/golem_activity_views.xml @@ -0,0 +1,47 @@ + + + + + + + + Golem activity form activity registration payment adaptations + golem.activity + + + + + + + + + + Golem Activity Search activity registration payment adaptations + golem.activity + + + + + + + + + From 0c3a62cac8cc14b11e3e80eb4e491a6c19e3ceaf Mon Sep 17 00:00:00 2001 From: youssef Date: Wed, 19 Sep 2018 16:53:30 +0100 Subject: [PATCH 17/69] Edit models/__init__ --- golem_activity_registration_payment/models/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/golem_activity_registration_payment/models/__init__.py b/golem_activity_registration_payment/models/__init__.py index 461a002..8a33eed 100644 --- a/golem_activity_registration_payment/models/__init__.py +++ b/golem_activity_registration_payment/models/__init__.py @@ -15,4 +15,4 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from . import golem_member, golem_activity_registration +from . import golem_member, golem_activity_registration, golem_activity From cbfccd551520add96566de9a34da0e6a8fba28a0 Mon Sep 17 00:00:00 2001 From: youssef Date: Wed, 19 Sep 2018 16:54:35 +0100 Subject: [PATCH 18/69] Prevent free activity from being invoiced --- golem_activity_registration_payment/models/golem_member.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/golem_activity_registration_payment/models/golem_member.py b/golem_activity_registration_payment/models/golem_member.py index b5fc6ab..b11a777 100644 --- a/golem_activity_registration_payment/models/golem_member.py +++ b/golem_activity_registration_payment/models/golem_member.py @@ -36,7 +36,8 @@ class GolemMember(models.Model): regis = regis.filtered( lambda r: (r.state == 'confirmed' and (not r.invoice_line_id or - r.invoice_line_id.invoice_id.state == 'cancel')) + r.invoice_line_id.invoice_id.state == 'cancel') and + not r.activity_id.free_activity) ) member.has_invoicable_registrations = bool(len(regis)) @@ -54,7 +55,8 @@ class GolemMember(models.Model): registrations = member.activity_registration_ids.filtered( lambda r: r.state == 'confirmed' and (not r.invoice_line_id or - r.invoice_line_id.invoice_id.state == 'cancel') + r.invoice_line_id.invoice_id.state == 'cancel') and + not r.activity_id.free_activity ) if registrations: invoicing = self.env['golem.activity.registration.invoicing'].create({ From 425ddd4f02ffd20a8310c1837a8f23e0b114ea0f Mon Sep 17 00:00:00 2001 From: youssef Date: Thu, 20 Sep 2018 13:48:26 +0100 Subject: [PATCH 19/69] Add field and filter to activity views --- golem_activity_registration/views/golem_activity_views.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/golem_activity_registration/views/golem_activity_views.xml b/golem_activity_registration/views/golem_activity_views.xml index fde9b43..a3827d5 100644 --- a/golem_activity_registration/views/golem_activity_views.xml +++ b/golem_activity_registration/views/golem_activity_views.xml @@ -38,6 +38,9 @@ along with this program. If not, see . + + + @@ -66,6 +69,8 @@ along with this program. If not, see . + From 59d8b897f6bf62a7401bb6036960ece5f140abd2 Mon Sep 17 00:00:00 2001 From: youssef Date: Thu, 20 Sep 2018 13:49:01 +0100 Subject: [PATCH 20/69] Add field and logic to models --- .../models/golem_activity_registration.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/golem_activity_registration/models/golem_activity_registration.py b/golem_activity_registration/models/golem_activity_registration.py index 4a69f08..7dcbb8d 100644 --- a/golem_activity_registration/models/golem_activity_registration.py +++ b/golem_activity_registration/models/golem_activity_registration.py @@ -43,6 +43,7 @@ class GolemActivity(models.Model): index=True) places_used = fields.Integer('Places used', compute='compute_places_used', store=True) + only_for_subscriber = fields.Boolean(required=True) @api.multi @api.depends('activity_registration_ids') @@ -96,6 +97,11 @@ class GolemActivityRegistration(models.Model): """ Forbid registration when member season if not coherent with activity season or are duplicates """ for reg in self: + if (reg.activity_id.only_for_subscriber and \ + reg.member_id.membership_state in ['none', 'canceled', 'old']): + emsg = _('Subscription can not be executed : the targeted ' + 'activity is only for subscriber.') + raise models.ValidationError(emsg) if reg.activity_id.season_id not in reg.member_id.season_ids: emsg = _('Subscription can not be executed : the targeted ' 'member is not on the same season as the activity.') From 206041d3be092a8174a5a592058ffe95f5ca3d7a Mon Sep 17 00:00:00 2001 From: youssef Date: Thu, 20 Sep 2018 13:59:20 +0100 Subject: [PATCH 21/69] remove init --- .../__init__.py | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 golem_activity_limite_registration/__init__.py diff --git a/golem_activity_limite_registration/__init__.py b/golem_activity_limite_registration/__init__.py deleted file mode 100644 index 1fced20..0000000 --- a/golem_activity_limite_registration/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- 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 . - -from . import models From e8c38a09efc0ab1fa75d98ebf72dfca71149f41b Mon Sep 17 00:00:00 2001 From: youssef Date: Thu, 20 Sep 2018 14:00:24 +0100 Subject: [PATCH 22/69] remove limite_registration module --- .../__manifest__.py | 31 ------------- .../models/__init__.py | 19 -------- .../models/golem_activity.py | 27 ----------- .../models/golem_activity_registration.py | 35 -------------- .../views/golem_activity_views.xml | 46 ------------------- 5 files changed, 158 deletions(-) delete mode 100644 golem_activity_limite_registration/__manifest__.py delete mode 100644 golem_activity_limite_registration/models/__init__.py delete mode 100644 golem_activity_limite_registration/models/golem_activity.py delete mode 100644 golem_activity_limite_registration/models/golem_activity_registration.py delete mode 100644 golem_activity_limite_registration/views/golem_activity_views.xml diff --git a/golem_activity_limite_registration/__manifest__.py b/golem_activity_limite_registration/__manifest__.py deleted file mode 100644 index 8c0d8ab..0000000 --- a/golem_activity_limite_registration/__manifest__.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- 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 . - -{ - 'name': 'GOLEM activity limite registration', - 'summary': 'GOLEM activity limite registration', - 'description': ''' GOLEM activity limite registration ''', - 'version': '10.0.0.0.1', - 'category': 'GOLEM', - 'author': 'Youssef El Ouahby, Fabien Bourgeois', - 'license': 'AGPL-3', - 'application': True, - 'installable': True, - 'depends': ['golem_activity', 'golem_activity_registration'], - 'data': ['views/golem_activity_views.xml'] -} diff --git a/golem_activity_limite_registration/models/__init__.py b/golem_activity_limite_registration/models/__init__.py deleted file mode 100644 index 56a42c2..0000000 --- a/golem_activity_limite_registration/models/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- 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 . - -from . import golem_activity, golem_activity_registration diff --git a/golem_activity_limite_registration/models/golem_activity.py b/golem_activity_limite_registration/models/golem_activity.py deleted file mode 100644 index 999b543..0000000 --- a/golem_activity_limite_registration/models/golem_activity.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- 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 Activity adaptations """ - -from odoo import models, fields, api, _ - -class GolemActivity(models.Model): - """ GOLEM Activity adaptations """ - _inherit = 'golem.activity' - - only_for_subscriber = fields.Boolean(required=True) diff --git a/golem_activity_limite_registration/models/golem_activity_registration.py b/golem_activity_limite_registration/models/golem_activity_registration.py deleted file mode 100644 index 1da353b..0000000 --- a/golem_activity_limite_registration/models/golem_activity_registration.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- 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 Activity Registration """ - -from odoo import models, fields, api, _ - -class GolemActivityRegistration(models.Model): - """ GOLEM Activity Registration """ - _inherit = 'golem.activity.registration' - - @api.constrains('member_id') - def _check_member_reliability(self): - """ Forbid registration when user doesn't have a valide membership """ - for reg in self: - if reg.activity_id.only_for_subscriber: - if reg.member_id.membership_state in ['none', 'canceled', 'old']: - emsg = _('Subscription can not be executed : the targeted ' - 'activity is only for subscriber.') - raise models.ValidationError(emsg) diff --git a/golem_activity_limite_registration/views/golem_activity_views.xml b/golem_activity_limite_registration/views/golem_activity_views.xml deleted file mode 100644 index 543a666..0000000 --- a/golem_activity_limite_registration/views/golem_activity_views.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - Golem Activity Form Limite Registration Adapations - golem.activity - - - - - - - - - Golem Activity Search Limite Registration Adapations - golem.activity - - - - - - - - - From 518749b78fe5c5701b6a381b987df888fd14d68d Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 24 Sep 2018 15:56:40 +0200 Subject: [PATCH 23/69] [REF]GOLEM PCS : several refactorings --- golem_pcs/data/golem_pcs_data.xml | 20 ++++++++------------ golem_pcs/models/golem_member.py | 6 +++--- golem_pcs/models/golem_pcs.py | 15 ++++++++++++--- golem_pcs/views/golem_member_views.xml | 7 ++++--- 4 files changed, 27 insertions(+), 21 deletions(-) diff --git a/golem_pcs/data/golem_pcs_data.xml b/golem_pcs/data/golem_pcs_data.xml index 2378cb3..dd63638 100644 --- a/golem_pcs/data/golem_pcs_data.xml +++ b/golem_pcs/data/golem_pcs_data.xml @@ -24,39 +24,35 @@ along with this program. If not, see . Agriculteurs exploitants - 1 + 01 Artisans, commerçants et chefs d’entreprise - 2 + 02 Cadres et professions intellectuelles supérieures - 3 + 03 Professions intermédiaires - 4 + 04 Employés - 5 + 05 Ouvriers - 6 + 06 Retraités - 7 - - - Retraités - 7 + 07 Autres personnes sans activité professionnelle - 8 + 08 diff --git a/golem_pcs/models/golem_member.py b/golem_pcs/models/golem_member.py index c5e586c..3eead3d 100644 --- a/golem_pcs/models/golem_member.py +++ b/golem_pcs/models/golem_member.py @@ -18,11 +18,11 @@ """ GOLEM Member adaptations """ -from odoo import models, fields, api, _ +from odoo import models, fields class GolemMember(models.Model): """ GOLEM Member extention """ _inherit = 'golem.member' - pcs_id = fields.Many2one('golem.pcs', string='Professions and Socioprofessional Categories', - domain="[('parent_id', '!=', False)]") + pcs_id = fields.Many2one('golem.pcs', string='PCS', index=True, + help='Professions and Socioprofessional Categories') diff --git a/golem_pcs/models/golem_pcs.py b/golem_pcs/models/golem_pcs.py index 52f9ccf..82a9960 100644 --- a/golem_pcs/models/golem_pcs.py +++ b/golem_pcs/models/golem_pcs.py @@ -18,12 +18,21 @@ """ GOLEM PCS """ -from odoo import models, fields, api, _ +from odoo import models, fields, api class GolemPCS(models.Model): """ GOLEM PCS """ _name = 'golem.pcs' + _rec_name = 'full_name' + _order = 'code asc' - name = fields.Char(required=True, index=True) + full_name = fields.Char(compute='_compute_full_name', store=True, index=True) + name = fields.Char(required=True) code = fields.Char() - parent_id = fields.Many2one('golem.pcs', ondelete='cascade', index=True) + parent_id = fields.Many2one('golem.pcs', ondelete='cascade') + + @api.depends('name', 'code') + def _compute_full_name(self): + """ Computes full name """ + for pcs in self: + pcs.full_name = u'%s - %s' % (pcs.code, pcs.name) if pcs.code else pcs.name diff --git a/golem_pcs/views/golem_member_views.xml b/golem_pcs/views/golem_member_views.xml index 2d4957e..67bdf1e 100644 --- a/golem_pcs/views/golem_member_views.xml +++ b/golem_pcs/views/golem_member_views.xml @@ -28,10 +28,11 @@ along with this program. If not, see . - + + GOLEM Member Search PCS adaptations @@ -39,10 +40,10 @@ along with this program. If not, see . - + - + From d00462aa41378ccc5548e1dedadd32bb67ad89b6 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 24 Sep 2018 16:07:47 +0200 Subject: [PATCH 24/69] [ADD]GOLEM PCS : move to partner, add on partner forms --- golem_pcs/__manifest__.py | 1 + golem_pcs/models/__init__.py | 2 +- .../{golem_member.py => res_partner.py} | 8 ++-- golem_pcs/views/res_partner_views.xml | 48 +++++++++++++++++++ 4 files changed, 54 insertions(+), 5 deletions(-) rename golem_pcs/models/{golem_member.py => res_partner.py} (88%) create mode 100644 golem_pcs/views/res_partner_views.xml diff --git a/golem_pcs/__manifest__.py b/golem_pcs/__manifest__.py index a513241..0d6ef8a 100644 --- a/golem_pcs/__manifest__.py +++ b/golem_pcs/__manifest__.py @@ -27,5 +27,6 @@ 'installable': True, 'depends': ['golem_member'], 'data': ['views/golem_member_views.xml', + 'views/res_partner_views.xml', 'data/golem_pcs_data.xml'] } diff --git a/golem_pcs/models/__init__.py b/golem_pcs/models/__init__.py index 2f1f33a..1e7b183 100644 --- a/golem_pcs/models/__init__.py +++ b/golem_pcs/models/__init__.py @@ -16,4 +16,4 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from . import golem_member, golem_pcs +from . import res_partner, golem_pcs diff --git a/golem_pcs/models/golem_member.py b/golem_pcs/models/res_partner.py similarity index 88% rename from golem_pcs/models/golem_member.py rename to golem_pcs/models/res_partner.py index 3eead3d..17a6dc4 100644 --- a/golem_pcs/models/golem_member.py +++ b/golem_pcs/models/res_partner.py @@ -16,13 +16,13 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -""" GOLEM Member adaptations """ +""" Partner adaptations """ from odoo import models, fields -class GolemMember(models.Model): - """ GOLEM Member extention """ - _inherit = 'golem.member' +class ResPartner(models.Model): + """ Partner extention """ + _inherit = 'res.partner' pcs_id = fields.Many2one('golem.pcs', string='PCS', index=True, help='Professions and Socioprofessional Categories') diff --git a/golem_pcs/views/res_partner_views.xml b/golem_pcs/views/res_partner_views.xml new file mode 100644 index 0000000..676174b --- /dev/null +++ b/golem_pcs/views/res_partner_views.xml @@ -0,0 +1,48 @@ + + + + + + + + + + Partner Form PCS adaptations + res.partner + + + + + + + + + + + Partner Search PCS adaptations + res.partner + + + + + + + + + From 0f92e44b5c54b84243a80e7ec22b004d85a7a81a Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 24 Sep 2018 16:20:17 +0200 Subject: [PATCH 25/69] [IMP]GOLEM PCS : no_open on PCS forms --- golem_pcs/views/golem_member_views.xml | 2 +- golem_pcs/views/res_partner_views.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/golem_pcs/views/golem_member_views.xml b/golem_pcs/views/golem_member_views.xml index 67bdf1e..b8bddf5 100644 --- a/golem_pcs/views/golem_member_views.xml +++ b/golem_pcs/views/golem_member_views.xml @@ -28,7 +28,7 @@ along with this program. If not, see . - + diff --git a/golem_pcs/views/res_partner_views.xml b/golem_pcs/views/res_partner_views.xml index 676174b..6bfa282 100644 --- a/golem_pcs/views/res_partner_views.xml +++ b/golem_pcs/views/res_partner_views.xml @@ -28,7 +28,7 @@ along with this program. If not, see . - + From 0f07bb09eb57c00294b7de226a94a2dbedfd2226 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 24 Sep 2018 16:15:14 +0200 Subject: [PATCH 26/69] [ADD]GOLEM PCS : base security access --- golem_pcs/__manifest__.py | 7 ++++--- golem_pcs/security/ir.model.access.csv | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 golem_pcs/security/ir.model.access.csv diff --git a/golem_pcs/__manifest__.py b/golem_pcs/__manifest__.py index 0d6ef8a..b2cb7d5 100644 --- a/golem_pcs/__manifest__.py +++ b/golem_pcs/__manifest__.py @@ -26,7 +26,8 @@ 'application': False, 'installable': True, 'depends': ['golem_member'], - 'data': ['views/golem_member_views.xml', - 'views/res_partner_views.xml', - 'data/golem_pcs_data.xml'] + 'data': ['security/ir.model.access.csv', + 'data/golem_pcs_data.xml', + 'views/golem_member_views.xml', + 'views/res_partner_views.xml'] } diff --git a/golem_pcs/security/ir.model.access.csv b/golem_pcs/security/ir.model.access.csv new file mode 100644 index 0000000..298dc4d --- /dev/null +++ b/golem_pcs/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_golem_pcs_user,Access GOLEM PCS User,model_golem_pcs,base.group_user,1,0,0,0 +access_golem_pcs_golem_user,Access GOLEM PCS GOLEM User,model_golem_pcs,golem_base.group_golem_user,1,0,0,0 +access_golem_pcs_golem_manager,Access GOLEM PCS GOLEM Manager,model_golem_pcs,golem_base.group_golem_manager,1,1,1,1 From ba375e62dd2c370300937bd609e59ceee762a89c Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 24 Sep 2018 16:17:43 +0200 Subject: [PATCH 27/69] [ADD]GOLEM PCS : i18n translations --- golem_pcs/i18n/fr.po | 106 +++++++++++++++++++++++++++++++++++ golem_pcs/i18n/golem_pcs.pot | 106 +++++++++++++++++++++++++++++++++++ 2 files changed, 212 insertions(+) create mode 100644 golem_pcs/i18n/fr.po create mode 100644 golem_pcs/i18n/golem_pcs.pot diff --git a/golem_pcs/i18n/fr.po b/golem_pcs/i18n/fr.po new file mode 100644 index 0000000..2813962 --- /dev/null +++ b/golem_pcs/i18n/fr.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * golem_pcs +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-09-24 14:16+0000\n" +"PO-Revision-Date: 2018-09-24 16:17+0200\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: golem_pcs +#: model:ir.ui.view,arch_db:golem_pcs.golem_member_search_inherit_golem_pcs +msgid "By PCS" +msgstr "Par PCS" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_code +msgid "Code" +msgstr "Code" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_create_date +msgid "Created on" +msgstr "Créé le" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_full_name +msgid "Full name" +msgstr "Nom" + +#. module: golem_pcs +#: model:ir.model,name:golem_pcs.model_golem_member +msgid "GOLEM Member" +msgstr "Adhérent" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_id +msgid "ID" +msgstr "ID" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs___last_update +msgid "Last Modified on" +msgstr "Dernière Modification le" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_write_date +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_name +msgid "Name" +msgstr "Nom" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_member_pcs_id +#: model:ir.model.fields,field_description:golem_pcs.field_res_partner_pcs_id +#: model:ir.model.fields,field_description:golem_pcs.field_res_users_pcs_id +msgid "PCS" +msgstr "PCS" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_parent_id +msgid "Parent id" +msgstr "Parent" + +#. module: golem_pcs +#: model:ir.model,name:golem_pcs.model_res_partner +msgid "Partner" +msgstr "Partenaire" + +#. module: golem_pcs +#: model:ir.model.fields,help:golem_pcs.field_golem_member_pcs_id +#: model:ir.model.fields,help:golem_pcs.field_res_partner_pcs_id +#: model:ir.model.fields,help:golem_pcs.field_res_users_pcs_id +msgid "Professions and Socioprofessional Categories" +msgstr "Professions et catégories socioprofessionnelles" + +#. module: golem_pcs +#: model:ir.model,name:golem_pcs.model_golem_pcs +msgid "golem.pcs" +msgstr "golem.pcs" + diff --git a/golem_pcs/i18n/golem_pcs.pot b/golem_pcs/i18n/golem_pcs.pot new file mode 100644 index 0000000..dbaa2af --- /dev/null +++ b/golem_pcs/i18n/golem_pcs.pot @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * golem_pcs +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-09-24 14:16+0000\n" +"PO-Revision-Date: 2018-09-24 14:16+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: golem_pcs +#: model:ir.ui.view,arch_db:golem_pcs.golem_member_search_inherit_golem_pcs +msgid "By PCS" +msgstr "" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_code +msgid "Code" +msgstr "" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_create_uid +msgid "Created by" +msgstr "" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_create_date +msgid "Created on" +msgstr "" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_display_name +msgid "Display Name" +msgstr "" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_full_name +msgid "Full name" +msgstr "" + +#. module: golem_pcs +#: model:ir.model,name:golem_pcs.model_golem_member +msgid "GOLEM Member" +msgstr "" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_id +msgid "ID" +msgstr "" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs___last_update +msgid "Last Modified on" +msgstr "" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_write_uid +msgid "Last Updated by" +msgstr "" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_write_date +msgid "Last Updated on" +msgstr "" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_name +msgid "Name" +msgstr "" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_member_pcs_id +#: model:ir.model.fields,field_description:golem_pcs.field_res_partner_pcs_id +#: model:ir.model.fields,field_description:golem_pcs.field_res_users_pcs_id +msgid "PCS" +msgstr "" + +#. module: golem_pcs +#: model:ir.model.fields,field_description:golem_pcs.field_golem_pcs_parent_id +msgid "Parent id" +msgstr "" + +#. module: golem_pcs +#: model:ir.model,name:golem_pcs.model_res_partner +msgid "Partner" +msgstr "" + +#. module: golem_pcs +#: model:ir.model.fields,help:golem_pcs.field_golem_member_pcs_id +#: model:ir.model.fields,help:golem_pcs.field_res_partner_pcs_id +#: model:ir.model.fields,help:golem_pcs.field_res_users_pcs_id +msgid "Professions and Socioprofessional Categories" +msgstr "" + +#. module: golem_pcs +#: model:ir.model,name:golem_pcs.model_golem_pcs +msgid "golem.pcs" +msgstr "" + From 87e7bccb57c578016c7908604cf6eca768b5b826 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Wed, 26 Sep 2018 10:33:17 +0200 Subject: [PATCH 28/69] [ADD]GOLEM Activity Registration : dynamic domain for only subscribers * Filter members according to activity ; * Filter activities according to member. --- golem_activity_registration/__manifest__.py | 2 +- golem_activity_registration/i18n/fr.po | 23 +++++++++++++++---- .../i18n/golem_activity_registration.pot | 23 +++++++++++++++---- .../models/golem_activity_registration.py | 19 ++++++++++++++- .../views/golem_activity_views.xml | 2 +- 5 files changed, 56 insertions(+), 13 deletions(-) diff --git a/golem_activity_registration/__manifest__.py b/golem_activity_registration/__manifest__.py index d2ce101..f760937 100644 --- a/golem_activity_registration/__manifest__.py +++ b/golem_activity_registration/__manifest__.py @@ -18,7 +18,7 @@ { 'name': 'GOLEM Activity Member Registrations', 'summary': 'GOLEM Activities Member Registrations management', - 'version': '10.0.1.4.5', + 'version': '10.0.1.5.0', 'category': 'GOLEM', 'author': 'Fabien Bourgeois, Michel Dessenne', 'license': 'AGPL-3', diff --git a/golem_activity_registration/i18n/fr.po b/golem_activity_registration/i18n/fr.po index 4c5b9c7..bddeb50 100644 --- a/golem_activity_registration/i18n/fr.po +++ b/golem_activity_registration/i18n/fr.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-08-09 14:23+0000\n" -"PO-Revision-Date: 2018-08-09 16:38+0200\n" +"POT-Creation-Date: 2018-09-26 08:25+0000\n" +"PO-Revision-Date: 2018-09-26 10:28+0200\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -204,6 +204,13 @@ msgstr "Le nombre de places ne peut pas être négatif" msgid "On default season, there is no activity for this member." msgstr "Sur la saison par défaut, il n'y a pas d'activité pour cet usager." +#. module: golem_activity_registration +#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_only_for_subscriber +#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_registration_only_for_subscriber +#: model:ir.ui.view,arch_db:golem_activity_registration.golem_activity_search_inherit_registration +msgid "Only for subscriber" +msgstr "Réservé aux adhérents" + #. module: golem_activity_registration #: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_places msgid "Places" @@ -245,7 +252,7 @@ msgid "Service user" msgstr "Usager" #. module: golem_activity_registration -#: code:addons/golem_activity_registration/models/golem_activity_registration.py:70 +#: code:addons/golem_activity_registration/models/golem_activity_registration.py:71 #, python-format msgid "Sorry, there is no more place !" msgstr "Désolé, il n'y a plus de place disponible !" @@ -256,13 +263,19 @@ msgid "Subscription" msgstr "Inscription" #. module: golem_activity_registration -#: code:addons/golem_activity_registration/models/golem_activity_registration.py:100 +#: code:addons/golem_activity_registration/models/golem_activity_registration.py:130 +#, python-format +msgid "Subscription can not be executed : the targeted activity is only for subscriber." +msgstr "L'inscription n'a pas pu être faite : l'activité choisie est réservée aux adhérents." + +#. module: golem_activity_registration +#: code:addons/golem_activity_registration/models/golem_activity_registration.py:134 #, python-format msgid "Subscription can not be executed : the targeted member is not on the same season as the activity." msgstr "L'inscription n'a pas pu être enregistrée : l'usager visé n'est pas ahdérant pour la même saison que celle pendant laquelle se déroule l'activité." #. module: golem_activity_registration -#: code:addons/golem_activity_registration/models/golem_activity_registration.py:92 +#: code:addons/golem_activity_registration/models/golem_activity_registration.py:104 #: sql_constraint:golem.activity.registration:0 #, python-format msgid "This member has already been registered for this activity." diff --git a/golem_activity_registration/i18n/golem_activity_registration.pot b/golem_activity_registration/i18n/golem_activity_registration.pot index b56cd83..4bc0b2b 100644 --- a/golem_activity_registration/i18n/golem_activity_registration.pot +++ b/golem_activity_registration/i18n/golem_activity_registration.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-08-09 14:23+0000\n" -"PO-Revision-Date: 2018-08-09 14:23+0000\n" +"POT-Creation-Date: 2018-09-26 08:25+0000\n" +"PO-Revision-Date: 2018-09-26 08:25+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -204,6 +204,13 @@ msgstr "" msgid "On default season, there is no activity for this member." msgstr "" +#. module: golem_activity_registration +#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_only_for_subscriber +#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_registration_only_for_subscriber +#: model:ir.ui.view,arch_db:golem_activity_registration.golem_activity_search_inherit_registration +msgid "Only for subscriber" +msgstr "" + #. module: golem_activity_registration #: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_places msgid "Places" @@ -245,7 +252,7 @@ msgid "Service user" msgstr "" #. module: golem_activity_registration -#: code:addons/golem_activity_registration/models/golem_activity_registration.py:70 +#: code:addons/golem_activity_registration/models/golem_activity_registration.py:71 #, python-format msgid "Sorry, there is no more place !" msgstr "" @@ -256,13 +263,19 @@ msgid "Subscription" msgstr "" #. module: golem_activity_registration -#: code:addons/golem_activity_registration/models/golem_activity_registration.py:100 +#: code:addons/golem_activity_registration/models/golem_activity_registration.py:130 +#, python-format +msgid "Subscription can not be executed : the targeted activity is only for subscriber." +msgstr "" + +#. module: golem_activity_registration +#: code:addons/golem_activity_registration/models/golem_activity_registration.py:134 #, python-format msgid "Subscription can not be executed : the targeted member is not on the same season as the activity." msgstr "" #. module: golem_activity_registration -#: code:addons/golem_activity_registration/models/golem_activity_registration.py:92 +#: code:addons/golem_activity_registration/models/golem_activity_registration.py:104 #: sql_constraint:golem.activity.registration:0 #, python-format msgid "This member has already been registered for this activity." diff --git a/golem_activity_registration/models/golem_activity_registration.py b/golem_activity_registration/models/golem_activity_registration.py index 7dcbb8d..f42e4d3 100644 --- a/golem_activity_registration/models/golem_activity_registration.py +++ b/golem_activity_registration/models/golem_activity_registration.py @@ -76,7 +76,7 @@ class GolemActivityRegistration(models.Model): """ GOLEM Activity Registration """ _name = 'golem.activity.registration' _description = 'GOLEM Activity Registration' - _rec_name ='activity_id' + _rec_name = 'activity_id' member_id = fields.Many2one('golem.member', string='Service user', required=True, ondelete='cascade', index=True) @@ -92,6 +92,23 @@ class GolemActivityRegistration(models.Model): ('registration_uniq', 'UNIQUE (member_id, activity_id)', _('This member has already been registered for this activity.'))] + @api.onchange('activity_id', 'activity_id.only_for_subscriber') + def onchange_activity_subcrib(self): + """ If activity only for subscribers : do not allow non subscribers """ + domain = [] + if self.activity_id.only_for_subscriber: + domain.append(('membership_state', 'not in', ('none', 'canceled', 'old'))) + return {'domain': {'member_id': domain}} + + @api.onchange('member_id') + def onchange_member_subcrib(self): + """ If not subscriber : do not show subscribers only activities """ + domain = [] + if self.member_id and self.member_id.membership_state in ('none', 'canceled', 'old'): + domain.append(('only_for_subscriber', '=', False)) + return {'domain': {'activity_id': domain}} + + @api.constrains('member_id', 'activity_id') def _check_season_reliability(self): """ Forbid registration when member season if not coherent with diff --git a/golem_activity_registration/views/golem_activity_views.xml b/golem_activity_registration/views/golem_activity_views.xml index a3827d5..265455e 100644 --- a/golem_activity_registration/views/golem_activity_views.xml +++ b/golem_activity_registration/views/golem_activity_views.xml @@ -38,7 +38,7 @@ along with this program. If not, see . - + From 223bc581fd432f489cbb57c11fc0c3142b286415 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Wed, 26 Sep 2018 11:41:38 +0200 Subject: [PATCH 29/69] [REF][IMP]GOLEM Activity Registration Payment free activities --- .../__manifest__.py | 3 ++- .../models/golem_activity.py | 11 +++++++++-- .../models/golem_activity_registration.py | 1 + .../models/golem_member.py | 12 ++++++------ .../views/golem_activity_registration_views.xml | 6 ++++++ .../views/golem_activity_views.xml | 15 ++++++++++----- 6 files changed, 34 insertions(+), 14 deletions(-) diff --git a/golem_activity_registration_payment/__manifest__.py b/golem_activity_registration_payment/__manifest__.py index 87325cc..99193bf 100644 --- a/golem_activity_registration_payment/__manifest__.py +++ b/golem_activity_registration_payment/__manifest__.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # Copyright 2018 Fabien Bourgeois +# Copyright 2018 Youssef El Ouahby # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -19,7 +20,7 @@ 'name': 'GOLEM Activity Member Registration Payments', 'summary': 'GOLEM Activities Member Registration Payments', 'description': 'GOLEM Activities Member Registration Payments', - 'version': '10.0.0.3.6', + 'version': '10.0.0.4.0', 'category': 'GOLEM', 'author': 'Fabien Bourgeois', 'license': 'AGPL-3', diff --git a/golem_activity_registration_payment/models/golem_activity.py b/golem_activity_registration_payment/models/golem_activity.py index 71acdb6..9dcd94b 100644 --- a/golem_activity_registration_payment/models/golem_activity.py +++ b/golem_activity_registration_payment/models/golem_activity.py @@ -18,10 +18,17 @@ """ GOLEM Activity adaptations """ -from odoo import models, fields +from odoo import models, fields, api class GolemActivity(models.Model): """ GOLEM Activity adaptations """ _inherit = 'golem.activity' - free_activity = fields.Boolean(required=True) + free_activity = fields.Boolean(default=False) + + @api.onchange('free_activity') + def onchange_free_activity(self): + """ If free activity, price should be 0.0 """ + for activity in self: + if activity.free_activity: + activity.list_price = 0.0 diff --git a/golem_activity_registration_payment/models/golem_activity_registration.py b/golem_activity_registration_payment/models/golem_activity_registration.py index b3d5361..9e8b475 100644 --- a/golem_activity_registration_payment/models/golem_activity_registration.py +++ b/golem_activity_registration_payment/models/golem_activity_registration.py @@ -31,3 +31,4 @@ class GolemActivityRegistration(models.Model): invoice_id = fields.Many2one(related='invoice_line_id.invoice_id') invoice_state = fields.Selection(related='invoice_line_id.invoice_id.state', store=True) + free_activity = fields.Boolean(related='activity_id.free_activity') diff --git a/golem_activity_registration_payment/models/golem_member.py b/golem_activity_registration_payment/models/golem_member.py index b11a777..30aa5b2 100644 --- a/golem_activity_registration_payment/models/golem_member.py +++ b/golem_activity_registration_payment/models/golem_member.py @@ -35,9 +35,9 @@ class GolemMember(models.Model): regis = member.activity_registration_ids regis = regis.filtered( lambda r: (r.state == 'confirmed' and + not r.activity_id.free_activity and (not r.invoice_line_id or - r.invoice_line_id.invoice_id.state == 'cancel') and - not r.activity_id.free_activity) + r.invoice_line_id.invoice_id.state == 'cancel')) ) member.has_invoicable_registrations = bool(len(regis)) @@ -53,10 +53,10 @@ class GolemMember(models.Model): self.ensure_one() member = self[0] registrations = member.activity_registration_ids.filtered( - lambda r: r.state == 'confirmed' and - (not r.invoice_line_id or - r.invoice_line_id.invoice_id.state == 'cancel') and - not r.activity_id.free_activity + lambda r: (r.state == 'confirmed' and + not r.activity_id.free_activity and + (not r.invoice_line_id or + r.invoice_line_id.invoice_id.state == 'cancel')) ) if registrations: invoicing = self.env['golem.activity.registration.invoicing'].create({ diff --git a/golem_activity_registration_payment/views/golem_activity_registration_views.xml b/golem_activity_registration_payment/views/golem_activity_registration_views.xml index 86fb72c..3bae912 100644 --- a/golem_activity_registration_payment/views/golem_activity_registration_views.xml +++ b/golem_activity_registration_payment/views/golem_activity_registration_views.xml @@ -45,6 +45,12 @@ along with this program. If not, see . + + + + + {'readonly': [('free_activity', '=', True)]} + diff --git a/golem_activity_registration_payment/views/golem_activity_views.xml b/golem_activity_registration_payment/views/golem_activity_views.xml index 1ee833a..08ba1be 100644 --- a/golem_activity_registration_payment/views/golem_activity_views.xml +++ b/golem_activity_registration_payment/views/golem_activity_views.xml @@ -22,24 +22,29 @@ along with this program. If not, see . - Golem activity form activity registration payment adaptations + Golem activity form adaptations golem.activity - - + + {'invisible': [('free_activity', '=', True)]} + + + + - Golem Activity Search activity registration payment adaptations + Golem Activity Search adaptations golem.activity - + From 661aabcfe8be6ff2590190fea7dd563d75d66217 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Wed, 26 Sep 2018 11:42:35 +0200 Subject: [PATCH 30/69] [FIX]GOLEM Activity Registration Payment : fix cascade on wizard invoicing --- golem_activity_registration_payment/__manifest__.py | 2 +- .../wizard/golem_activity_registration_invoicing.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/golem_activity_registration_payment/__manifest__.py b/golem_activity_registration_payment/__manifest__.py index 99193bf..2363982 100644 --- a/golem_activity_registration_payment/__manifest__.py +++ b/golem_activity_registration_payment/__manifest__.py @@ -20,7 +20,7 @@ 'name': 'GOLEM Activity Member Registration Payments', 'summary': 'GOLEM Activities Member Registration Payments', 'description': 'GOLEM Activities Member Registration Payments', - 'version': '10.0.0.4.0', + 'version': '10.0.0.4.1', 'category': 'GOLEM', 'author': 'Fabien Bourgeois', 'license': 'AGPL-3', diff --git a/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py b/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py index d21b3b4..6454666 100644 --- a/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py +++ b/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py @@ -29,9 +29,11 @@ class GolemActivityRegistrationInvoicingLine(models.TransientModel): _description = 'GOLEM Activity Registration Invoicing Lines' invoicing_id = fields.Many2one('golem.activity.registration.invoicing', - required=True) - registration_id = fields.Many2one('golem.activity.registration', required=True) - activity_id = fields.Many2one('golem.activity', required=True, readonly=True) + required=True, ondelete='cascade') + registration_id = fields.Many2one('golem.activity.registration', required=True, + ondelete='cascade') + activity_id = fields.Many2one('golem.activity', required=True, readonly=True, + ondelete='cascade') price = fields.Monetary() currency_id = fields.Many2one(related='activity_id.currency_id') From 18957c4568210b8d1af218fe84e52b1e059f7e34 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Wed, 26 Sep 2018 11:44:24 +0200 Subject: [PATCH 31/69] [IMP]GOLEM Activity Registration State : small enhancements * Reload client to reflect changes after unlink registration ; * Do no show buttons until registration has been saved. --- golem_activity_registration_state/__manifest__.py | 2 +- .../models/golem_activity_registration.py | 5 +++-- .../views/golem_activity_registration_views.xml | 9 +++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/golem_activity_registration_state/__manifest__.py b/golem_activity_registration_state/__manifest__.py index 87d50aa..c8bc7bf 100644 --- a/golem_activity_registration_state/__manifest__.py +++ b/golem_activity_registration_state/__manifest__.py @@ -19,7 +19,7 @@ 'name': 'GOLEM Activity Session Member Registrations States', 'summary': 'GOLEM Activities Session Member Registration states', 'description': 'GOLEM Activities Session Member Registration states', - 'version': '10.0.2.2.0', + 'version': '10.0.2.2.1', 'category': 'GOLEM', 'author': 'Fabien Bourgeois', 'license': 'AGPL-3', diff --git a/golem_activity_registration_state/models/golem_activity_registration.py b/golem_activity_registration_state/models/golem_activity_registration.py index fde5a1d..2b20d5d 100644 --- a/golem_activity_registration_state/models/golem_activity_registration.py +++ b/golem_activity_registration_state/models/golem_activity_registration.py @@ -18,7 +18,7 @@ """ GOLEM Activity Registration State """ from odoo import models, fields, api, _ -from odoo.exceptions import UserError +from odoo.exceptions import UserError, ValidationError class GolemMember(models.Model): """ GOLEM Member adaptations """ @@ -89,9 +89,10 @@ class GolemActivityRegistration(models.Model): def state_remove(self): """ Remove registrations, only if canceled """ if self.filtered(lambda r: r.state != 'canceled'): - uerr = _('You can not confirm a canceled registration.') + uerr = _('You can not remove a uncanceled registration.') raise UserError(uerr) self.unlink() + return {'type': 'ir.actions.client', 'tag': 'reload'} @api.multi def write(self, values): diff --git a/golem_activity_registration_state/views/golem_activity_registration_views.xml b/golem_activity_registration_state/views/golem_activity_registration_views.xml index e7305ed..694ef92 100644 --- a/golem_activity_registration_state/views/golem_activity_registration_views.xml +++ b/golem_activity_registration_state/views/golem_activity_registration_views.xml @@ -45,20 +45,21 @@ along with this program. If not, see . 0 +