Merge branch 'master' into activity_free

This commit is contained in:
Fabien BOURGEOIS 2018-09-26 10:37:06 +02:00
commit 08927bba53
16 changed files with 795 additions and 12 deletions

View File

@ -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',

View File

@ -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."

View File

@ -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."

View File

@ -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.')

View File

@ -38,6 +38,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</group>
</page>
</page>
<field name="audience_id" position="before">
<field name="only_for_subscriber"/>
</field>
</field>
</record>
@ -66,6 +69,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<filter name="season_default" position="after">
<filter name="full_activity" string="Full"
domain="[('places_remain', '=', 0)]" />
<filter name="only_for_subscriber" string="Only for subscriber"
domain="[('only_for_subscriber', '=', True)]"/>
</filter>
</field>
</record>

19
golem_pcs/__init__.py Normal file
View File

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
#
# 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 <http://www.gnu.org/licenses/>.
from . import models

33
golem_pcs/__manifest__.py Normal file
View File

@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
#
# 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 <http://www.gnu.org/licenses/>.
{
'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']
}

View File

@ -0,0 +1,277 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
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 <http://www.gnu.org/licenses/>.
-->
<odoo>
<data>
<!-- Groupes socioprofessionnels -->
<record model="golem.pcs" id="golem_pcs_agriculteurs_exploitants">
<field name="name">Agriculteurs exploitants</field>
<field name="code">01</field>
</record>
<record model="golem.pcs" id="golem_pcs_artisans_commercants_et_chefs_entreprise">
<field name="name">Artisans, commerçants et chefs dentreprise</field>
<field name="code">02</field>
</record>
<record model="golem.pcs" id="golem_pcs_cadres_et_professions_intellectuelles_superieures">
<field name="name">Cadres et professions intellectuelles supérieures</field>
<field name="code">03</field>
</record>
<record model="golem.pcs" id="golem_pcs_professions_intermediaires">
<field name="name">Professions intermédiaires</field>
<field name="code">04</field>
</record>
<record model="golem.pcs" id="golem_pcs_employes">
<field name="name">Employés</field>
<field name="code">05</field>
</record>
<record model="golem.pcs" id="golem_pcs_ouvriers">
<field name="name">Ouvriers</field>
<field name="code">06</field>
</record>
<record model="golem.pcs" id="golem_pcs_retraites">
<field name="name">Retraités</field>
<field name="code">07</field>
</record>
<record model="golem.pcs" id="golem_pcs_autres_personnes_sans_activite_professionnelle">
<field name="name">Autres personnes sans activité professionnelle</field>
<field name="code">08</field>
</record>
<!-- Catégories socioprofessionnelles -->
<record model="golem.pcs" id="golem_pcs_agriculteurs_sur_petite_exploitation">
<field name="name">Agriculteurs sur petite exploitation</field>
<field name="code">11</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_agriculteurs_exploitants')"/>
</record>
<record model="golem.pcs" id="golem_pcs_agriculteurs_sur_moyenne_exploitation">
<field name="name">Agriculteurs sur moyenne exploitation</field>
<field name="code">12</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_agriculteurs_exploitants')"/>
</record>
<record model="golem.pcs" id="golem_pcs_agriculteurs_sur_grande_exploitation">
<field name="name">Agriculteurs sur grande exploitation</field>
<field name="code">13</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_agriculteurs_exploitants')"/>
</record>
<record model="golem.pcs" id="golem_pcs_artisan">
<field name="name">Artisan</field>
<field name="code">21</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_artisans_commercants_et_chefs_entreprise')"/>
</record>
<record model="golem.pcs" id="golem_pcs_commercant_et_assimiles">
<field name="name">Commerçant et assimilés</field>
<field name="code">22</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_artisans_commercants_et_chefs_entreprise')"/>
</record>
<record model="golem.pcs" id="golem_pcs_Chefs_entreprise_de_10_salaries_ou_plus">
<field name="name">Chefs dentreprise de 10 salariés ou plus</field>
<field name="code">23</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_artisans_commercants_et_chefs_entreprise')"/>
</record>
<record model="golem.pcs" id="golem_pcs_professions_liberales">
<field name="name">Professions libérales</field>
<field name="code">31</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_cadres_et_professions_intellectuelles_superieures')"/>
</record>
<record model="golem.pcs" id="golem_pcs_cadres_de_la_fonction_publique">
<field name="name">Cadres de la fonction publique </field>
<field name="code">33</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_cadres_et_professions_intellectuelles_superieures')"/>
</record>
<record model="golem.pcs" id="golem_pcs_professeurs_professions_scientifiques">
<field name="name">Professeurs, professions scientifiques </field>
<field name="code">34</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_cadres_et_professions_intellectuelles_superieures')"/>
</record>
<record model="golem.pcs" id="golem_pcs_professions_de_l_information_des_arts_et_des_spectacles">
<field name="name">Professions de linformation, des arts et des spectacles</field>
<field name="code">35</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_cadres_et_professions_intellectuelles_superieures')"/>
</record>
<record model="golem.pcs" id="golem_pcs_cadres_administratifs_et_commerciaux_d_entreprise">
<field name="name">Cadres administratifs et commerciaux dentreprise</field>
<field name="code">37</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_cadres_et_professions_intellectuelles_superieures')"/>
</record>
<record model="golem.pcs" id="golem_pcs_ingenieurs_et_cadres_techniques_d_entreprise">
<field name="name">Ingénieurs et cadres techniques dentreprise</field>
<field name="code">38</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_cadres_et_professions_intellectuelles_superieures')"/>
</record>
<record model="golem.pcs" id="golem_pcs_professeurs_des_ecoles_instituteurs_et_assimiles">
<field name="name">Professeurs des écoles, instituteurs et assimilés</field>
<field name="code">42</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_professions_intermediaires')"/>
</record>
<record model="golem.pcs" id="golem_pcs_professions_intermediaires_de_la_sante_et_du_travail_social">
<field name="name">Professions intermédiaires de la santé et du travail social </field>
<field name="code">43</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_professions_intermediaires')"/>
</record>
<record model="golem.pcs" id="golem_pcs_clerge_religieux">
<field name="name">Clergé, religieux</field>
<field name="code">44</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_professions_intermediaires')"/>
</record>
<record model="golem.pcs" id="golem_pcs_professions_intermediaires_administratives_de_la_fonction_publique">
<field name="name">Professions intermédiaires administratives de la fonction publique</field>
<field name="code">45</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_professions_intermediaires')"/>
</record>
<record model="golem.pcs" id="golem_pcs_professions_intermediaires_administratives_et_commerciales_des_entreprises">
<field name="name">Professions intermédiaires administratives et commerciales des entreprises</field>
<field name="code">46</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_professions_intermediaires')"/>
</record>
<record model="golem.pcs" id="golem_pcs_techniciens">
<field name="name">Techniciens</field>
<field name="code">47</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_professions_intermediaires')"/>
</record>
<record model="golem.pcs" id="golem_pcs_contremaitres_agents_de_maitrise">
<field name="name">Contremaîtres, agents de maîtrise</field>
<field name="code">48</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_professions_intermediaires')"/>
</record>
<record model="golem.pcs" id="golem_pcs_employes_civils_et_agents_de_service_de_la_fonction_publique">
<field name="name">Employés civils et agents de service de la fonction publique</field>
<field name="code">52</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_employes')"/>
</record>
<record model="golem.pcs" id="golem_pcs_policiers_et_militaires">
<field name="name">Policiers et militaires</field>
<field name="code">53</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_employes')"/>
</record>
<record model="golem.pcs" id="golem_pcs_employes_administratifs_d_entreprise">
<field name="name">Employés administratifs dentreprise</field>
<field name="code">54</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_employes')"/>
</record>
<record model="golem.pcs" id="golem_pcs_employes_de_commerce">
<field name="name">Employés de commerce</field>
<field name="code">55</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_employes')"/>
</record>
<record model="golem.pcs" id="golem_pcs_personnels_des_services_directs_aux_particuliers">
<field name="name">Personnels des services directs aux particuliers </field>
<field name="code">56</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_employes')"/>
</record>
<record model="golem.pcs" id="golem_pcs_ouvriers_qualifies_de_type_industriel">
<field name="name">Ouvriers qualifiés de type industriel</field>
<field name="code">62</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_ouvriers')"/>
</record>
<record model="golem.pcs" id="golem_pcs_ouvriers_qualifies_de_type_artisanal">
<field name="name">Ouvriers qualifiés de type artisanal</field>
<field name="code">63</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_ouvriers')"/>
</record>
<record model="golem.pcs" id="golem_pcs_chauffeurs">
<field name="name">Chauffeurs</field>
<field name="code">64</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_ouvriers')"/>
</record>
<record model="golem.pcs" id="golem_pcs_ouvriers_qualifies_de_la_manutention_du_magasinage_et_du_transport ">
<field name="name">Ouvriers qualifiés de la manutention, du magasinage et du transport </field>
<field name="code">65</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_ouvriers')"/>
</record>
<record model="golem.pcs" id="golem_pcs_ouvriers_non_qualifies_de_type_industriel">
<field name="name">Ouvriers non qualifiés de type industriel</field>
<field name="code">67</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_ouvriers')"/>
</record>
<record model="golem.pcs" id="golem_pcs_ouvriers_non_qualifies_de_type_artisanal">
<field name="name">Ouvriers non qualifiés de type artisanal</field>
<field name="code">68</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_ouvriers')"/>
</record>
<record model="golem.pcs" id="golem_pcs_ouvriers_agricoles">
<field name="name">Ouvriers agricoles</field>
<field name="code">69</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_ouvriers')"/>
</record>
<record model="golem.pcs" id="golem_pcs_anciens_agriculteurs_exploitants">
<field name="name">Anciens agriculteurs exploitants</field>
<field name="code">71</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_retraites')"/>
</record>
<record model="golem.pcs" id="golem_pcs_anciens_artisans_commercants_et_chefs_d_entreprise">
<field name="name">Anciens artisans, commerçants et chefs dentreprise</field>
<field name="code">72</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_retraites')"/>
</record>
<record model="golem.pcs" id="golem_pcs_anciens_cadres">
<field name="name">Anciens cadres</field>
<field name="code">74</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_retraites')"/>
</record>
<record model="golem.pcs" id="golem_pcs_anciennes_professions_intermediaires">
<field name="name">Anciennes professions intermédiaires</field>
<field name="code">75</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_retraites')"/>
</record>
<record model="golem.pcs" id="golem_pcs_anciens_employes">
<field name="name">Anciens employés</field>
<field name="code">77</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_retraites')"/>
</record>
<record model="golem.pcs" id="golem_pcs_anciens_ouvriers">
<field name="name">Anciens ouvriers</field>
<field name="code">78</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_retraites')"/>
</record>
<record model="golem.pcs" id="golem_pcs_chomeurs_n_ayant_jamais_travaille">
<field name="name">Chômeurs nayant jamais travaillé</field>
<field name="code">81</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_autres_personnes_sans_activite_professionnelle')"/>
</record>
<record model="golem.pcs" id="golem_pcs_militaires_du_contingent">
<field name="name">Militaires du contingent </field>
<field name="code">83</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_autres_personnes_sans_activite_professionnelle')"/>
</record>
<record model="golem.pcs" id="golem_pcs_eleves_etudiants">
<field name="name">Élèves, étudiants</field>
<field name="code">84</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_autres_personnes_sans_activite_professionnelle')"/>
</record>
<record model="golem.pcs" id="golem_pcs_personnes_diverses_sans_activite_professionnelle_de_moins_de_60_ans_sauf_retraites">
<field name="name">Personnes diverses sans activité professionnelle de moins de 60 ans (sauf retraités)</field>
<field name="code">85</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_autres_personnes_sans_activite_professionnelle')"/>
</record>
<record model="golem.pcs" id="golem_pcs_personnes_diverses_sans_activite_professionnelle_de_60_ans_et_plus_sauf_retraites">
<field name="name">Personnes diverses sans activité professionnelle de 60 ans et plus (sauf retraités) </field>
<field name="code">86</field>
<field name="parent_id" eval="ref('golem_pcs.golem_pcs_autres_personnes_sans_activite_professionnelle')"/>
</record>
</data>
</odoo>

106
golem_pcs/i18n/fr.po Normal file
View File

@ -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"

View File

@ -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 ""

View File

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
#
# 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 <http://www.gnu.org/licenses/>.
from . import res_partner, golem_pcs

View File

@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
#
# 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 <http://www.gnu.org/licenses/>.
""" 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

View File

@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
#
# 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 <http://www.gnu.org/licenses/>.
""" 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')

View File

@ -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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_golem_pcs_user Access GOLEM PCS User model_golem_pcs base.group_user 1 0 0 0
3 access_golem_pcs_golem_user Access GOLEM PCS GOLEM User model_golem_pcs golem_base.group_golem_user 1 0 0 0
4 access_golem_pcs_golem_manager Access GOLEM PCS GOLEM Manager model_golem_pcs golem_base.group_golem_manager 1 1 1 1

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
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 <http://www.gnu.org/licenses/>.
-->
<odoo>
<data>
<!-- Forms -->
<record model="ir.ui.view" id="golem_member_form_inherit_golem_pcs">
<field name="name">GOLEM Member Form PCS adaptations</field>
<field name="model">golem.member</field>
<field name="inherit_id" ref="golem_member.golem_member_form" />
<field name="arch" type="xml">
<field name='function' position='after'>
<field name='pcs_id' options="{'no_create':True, 'no_open': True}" />
</field>
</field>
</record>
<!-- Search -->
<record model="ir.ui.view" id="golem_member_search_inherit_golem_pcs">
<field name="name">GOLEM Member Search PCS adaptations</field>
<field name="model">golem.member</field>
<field name="inherit_id" ref="golem_member.golem_member_search" />
<field name="arch" type="xml">
<field name='category_id' position='after'>
<field name='pcs_id' />
</field>
<filter name="group_city" position='after'>
<filter name="group_pcs" string="By PCS" context="{'group_by': 'pcs_id'}" />
</filter>
</field>
</record>
</data>
</odoo>

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
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 <http://www.gnu.org/licenses/>.
-->
<odoo>
<data>
<!-- Forms -->
<record model="ir.ui.view" id="res_partner_form_inherit_golem_pcs">
<field name="name">Partner Form PCS adaptations</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<field name='function' position='after'>
<field name='pcs_id' options="{'no_create':True, 'no_open': True}" />
</field>
</field>
</record>
<!-- Search -->
<record model="ir.ui.view" id="view_partner_search_inherit_golem_pcs">
<field name="name">Partner Search PCS adaptations</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter" />
<field name="arch" type="xml">
<field name='category_id' position='after'>
<field name='pcs_id' />
</field>
</field>
</record>
</data>
</odoo>