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 4a69f08..f42e4d3 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') @@ -75,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) @@ -91,11 +92,33 @@ 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 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.') diff --git a/golem_activity_registration/views/golem_activity_views.xml b/golem_activity_registration/views/golem_activity_views.xml index fde9b43..265455e 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 . + 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 diff --git a/golem_pcs/__manifest__.py b/golem_pcs/__manifest__.py new file mode 100644 index 0000000..b2cb7d5 --- /dev/null +++ b/golem_pcs/__manifest__.py @@ -0,0 +1,33 @@ +# -*- 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': ['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/data/golem_pcs_data.xml b/golem_pcs/data/golem_pcs_data.xml new file mode 100644 index 0000000..dd63638 --- /dev/null +++ b/golem_pcs/data/golem_pcs_data.xml @@ -0,0 +1,277 @@ + + + + + + + + + + Agriculteurs exploitants + 01 + + + Artisans, commerçants et chefs d’entreprise + 02 + + + Cadres et professions intellectuelles supérieures + 03 + + + Professions intermédiaires + 04 + + + Employés + 05 + + + Ouvriers + 06 + + + Retraités + 07 + + + Autres personnes sans activité professionnelle + 08 + + + + + 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 + + + + 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 "" + diff --git a/golem_pcs/models/__init__.py b/golem_pcs/models/__init__.py new file mode 100644 index 0000000..1e7b183 --- /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 res_partner, golem_pcs diff --git a/golem_pcs/models/golem_pcs.py b/golem_pcs/models/golem_pcs.py new file mode 100644 index 0000000..82a9960 --- /dev/null +++ b/golem_pcs/models/golem_pcs.py @@ -0,0 +1,38 @@ +# -*- 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' + _rec_name = 'full_name' + _order = 'code asc' + + 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') + + @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/models/res_partner.py b/golem_pcs/models/res_partner.py new file mode 100644 index 0000000..17a6dc4 --- /dev/null +++ b/golem_pcs/models/res_partner.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 . + +""" Partner adaptations """ + +from odoo import models, fields + +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/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 diff --git a/golem_pcs/views/golem_member_views.xml b/golem_pcs/views/golem_member_views.xml new file mode 100644 index 0000000..b8bddf5 --- /dev/null +++ b/golem_pcs/views/golem_member_views.xml @@ -0,0 +1,51 @@ + + + + + + + + + + GOLEM Member Form PCS adaptations + golem.member + + + + + + + + + + + GOLEM Member Search PCS adaptations + golem.member + + + + + + + + + + + + diff --git a/golem_pcs/views/res_partner_views.xml b/golem_pcs/views/res_partner_views.xml new file mode 100644 index 0000000..6bfa282 --- /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 + + + + + + + + +