Merge branch 'master' into legal_guardians

This commit is contained in:
Fabien BOURGEOIS 2018-10-23 18:30:04 +02:00
commit d78bac1c83
50 changed files with 1344 additions and 107 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.1',
'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(default=False)
@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>

View File

@ -20,11 +20,11 @@
'summary': 'GOLEM Activity Registration Custom Price',
'description': '''GOLEM Activity Registration Custom Price :
- allow set of 1:n slices based on family quotient ;
- allow set 1:n area data ;
- allow set 1:n root area data ;
- allow set price per area and slice ;
- computes automatically applicable price ;
- anticipate ruleset to be implemented for computing.''',
'version': '10.0.0.1.2',
'version': '10.0.0.2.0',
'category': 'GOLEM',
'author': 'Fabien Bourgeois',
'license': 'AGPL-3',

View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2018 Youssef El Ouahby <youssef@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
@ -43,7 +44,7 @@ class GolemActivity(models.Model):
existing_combinations = [u'%s-%s' % (line.area_id.id, line.slice_id.id)
for line in activity.price_line_ids]
slice_ids = self.env['golem.payment.rule.familyquotient.slice'].search([])
for area_id in self.env['golem.partner.area'].search([]):
for area_id in self.env['golem.partner.area'].search([('parent_id', '=', False)]):
for slice_id in slice_ids:
combination = u'%s-%s' % (area_id.id, slice_id.id)
if combination not in existing_combinations:

View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2018 Youssef El Ouahby <youssef@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
@ -40,7 +41,7 @@ class GolemMember(models.Model):
area_ids = self.env['golem.partner.area'].search([])
if member.area_id:
applicable_areas += area_ids.filtered(
lambda r: r == member.area_id
lambda r: r == member.area_id.root_id
)
if not applicable_areas and area_ids:
applicable_areas += area_ids[0]

View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2018 Youssef El Ouahby <youssef@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
@ -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.5.0',
'category': 'GOLEM',
'author': 'Fabien Bourgeois',
'license': 'AGPL-3',
@ -29,5 +30,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']
}

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-27 10:09+0000\n"
"PO-Revision-Date: 2018-08-27 12:10+0200\n"
"POT-Creation-Date: 2018-09-26 09:44+0000\n"
"PO-Revision-Date: 2018-09-26 11:58+0200\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -49,7 +49,7 @@ msgid "Activity id"
msgstr "Activité liée"
#. module: golem_activity_registration_payment
#: code:addons/golem_activity_registration_payment/models/golem_member.py:76
#: code:addons/golem_activity_registration_payment/models/golem_member.py:78
#, python-format
msgid "All confirmed registrations had already been invoiced."
msgstr "Toutes les inscriptions confirmées ont déjà été facturées."
@ -124,6 +124,18 @@ msgstr "Afficher les paiements"
msgid "Draft Invoice"
msgstr "Facture en brouillon"
#. module: golem_activity_registration_payment
#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_free_activity
#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_free_activity
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_search_inherit_activity_registration_payment
msgid "Free activity"
msgstr "Gratuit"
#. module: golem_activity_registration_payment
#: model:ir.model,name:golem_activity_registration_payment.model_golem_activity
msgid "GOLEM Activity"
msgstr "Activité"
#. module: golem_activity_registration_payment
#: model:ir.model,name:golem_activity_registration_payment.model_golem_activity_registration
msgid "GOLEM Activity Registration"
@ -145,14 +157,14 @@ msgid "GOLEM Member"
msgstr "Adhérent"
#. module: golem_activity_registration_payment
#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:151
#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:153
#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_invoice_id
#, python-format
msgid "Generated invoice"
msgstr "Facture générée"
#. module: golem_activity_registration_payment
#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:166
#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:168
#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_payment_ids
#, python-format
msgid "Generated payments"
@ -311,7 +323,7 @@ msgid "Registration id"
msgstr "Inscription"
#. module: golem_activity_registration_payment
#: code:addons/golem_activity_registration_payment/models/golem_member.py:69
#: code:addons/golem_activity_registration_payment/models/golem_member.py:71
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form
#, python-format
msgid "Registration invoicing"
@ -339,13 +351,13 @@ msgid "Status"
msgstr "État"
#. module: golem_activity_registration_payment
#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:147
#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:149
#, python-format
msgid "There is no generated invoice."
msgstr "Il n'y a pas de facture générée."
#. module: golem_activity_registration_payment
#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:162
#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:164
#, python-format
msgid "There is no generated payments."
msgstr "Il n'y a pas de paiement généré."

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-27 10:09+0000\n"
"PO-Revision-Date: 2018-08-27 10:09+0000\n"
"POT-Creation-Date: 2018-09-26 09:44+0000\n"
"PO-Revision-Date: 2018-09-26 09:44+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -45,7 +45,7 @@ msgid "Activity id"
msgstr ""
#. module: golem_activity_registration_payment
#: code:addons/golem_activity_registration_payment/models/golem_member.py:76
#: code:addons/golem_activity_registration_payment/models/golem_member.py:78
#, python-format
msgid "All confirmed registrations had already been invoiced."
msgstr ""
@ -120,6 +120,18 @@ msgstr ""
msgid "Draft Invoice"
msgstr ""
#. module: golem_activity_registration_payment
#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_free_activity
#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_free_activity
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_search_inherit_activity_registration_payment
msgid "Free activity"
msgstr ""
#. module: golem_activity_registration_payment
#: model:ir.model,name:golem_activity_registration_payment.model_golem_activity
msgid "GOLEM Activity"
msgstr ""
#. module: golem_activity_registration_payment
#: model:ir.model,name:golem_activity_registration_payment.model_golem_activity_registration
msgid "GOLEM Activity Registration"
@ -141,14 +153,14 @@ msgid "GOLEM Member"
msgstr ""
#. module: golem_activity_registration_payment
#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:151
#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:153
#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_invoice_id
#, python-format
msgid "Generated invoice"
msgstr ""
#. module: golem_activity_registration_payment
#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:166
#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:168
#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_payment_ids
#, python-format
msgid "Generated payments"
@ -307,7 +319,7 @@ msgid "Registration id"
msgstr ""
#. module: golem_activity_registration_payment
#: code:addons/golem_activity_registration_payment/models/golem_member.py:69
#: code:addons/golem_activity_registration_payment/models/golem_member.py:71
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form
#, python-format
msgid "Registration invoicing"
@ -335,13 +347,13 @@ msgid "Status"
msgstr ""
#. module: golem_activity_registration_payment
#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:147
#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:149
#, python-format
msgid "There is no generated invoice."
msgstr ""
#. module: golem_activity_registration_payment
#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:162
#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:164
#, python-format
msgid "There is no generated payments."
msgstr ""

View File

@ -15,4 +15,4 @@
# 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 golem_member, golem_activity_registration
from . import golem_member, golem_activity_registration, golem_activity

View File

@ -0,0 +1,34 @@
# -*- 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 Activity adaptations """
from odoo import models, fields, api
class GolemActivity(models.Model):
""" GOLEM Activity adaptations """
_inherit = 'golem.activity'
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

View File

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

View File

@ -35,6 +35,7 @@ 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'))
)
@ -52,9 +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')
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({

View File

@ -45,6 +45,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="inherit_id"
ref="golem_activity_registration_state.golem_activity_registration_tree_inherit_state" />
<field name="arch" type="xml">
<field name="activity_price" position="before">
<field name="free_activity" readonly="1" />
</field>
<field name="activity_price" position="attributes">
<attribute name="attrs">{'readonly': [('free_activity', '=', True)]}</attribute>
</field>
<field name="state" position="after">
<field name="invoice_line_id" invisible="1" />
<field name="invoice_state" string="Invoice state" />

View File

@ -0,0 +1,52 @@
<?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 id="golem_activity_form_inherit_activity_registration_payment"
model="ir.ui.view">
<field name="name">Golem activity form adaptations</field>
<field name="model">golem.activity</field>
<field name="inherit_id" ref="golem_activity.golem_activity_form" />
<field name="arch" type="xml">
<field name="list_price" position="attributes">
<attribute name="attrs">{'invisible': [('free_activity', '=', True)]}</attribute>
</field>
<field name="list_price" position="before">
<field name='free_activity' />
</field>
</field>
</record>
<!-- Search -->
<record id="golem_activity_search_inherit_activity_registration_payment"
model="ir.ui.view">
<field name="name">Golem Activity Search adaptations</field>
<field name="model">golem.activity</field>
<field name="inherit_id" ref="golem_activity.golem_activity_search" />
<field name="arch" type="xml">
<filter name="season_default" position="after">
<filter name="free_activity" string="Free activity"
domain="[('free_activity', '=', True)]" />
</filter>
</field>
</record>
</data>
</odoo>

View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright 2017-2018 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2018 Youssef El Ouahby <youssef@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
@ -29,9 +30,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')
@ -82,13 +85,21 @@ class GolemActivityRegistrationInvoicing(models.TransientModel):
""" Create invoice and lines """
self.ensure_one()
partner = self.member_id.partner_id
invoice = self.env['account.invoice'].create({
'partner_id': partner.id,
'account_id': partner.property_account_receivable_id.id,
'fiscal_position_id': partner.property_account_position_id.id
})
#check if there is a draft invoice for the current customer
member_line = partner.member_lines.filtered(
lambda ml: (ml.membership_id.membership_season_id == self.season_id
and ml.account_invoice_id.state == 'draft')
)
if member_line:
invoice = member_line[0].account_invoice_id
else:
invoice = self.env['account.invoice'].create({
'partner_id': partner.id,
'account_id': partner.property_account_receivable_id.id,
'fiscal_position_id': partner.property_account_position_id.id
})
for line in self.line_ids:
product = line.activity_id.product_id
product = line.activity_id.product_id.product_variant_id
invoice_line = self._create_invoice_line(product, line.price, invoice)
line.registration_id.invoice_line_id = invoice_line.id
return invoice

View File

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

View File

@ -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):

View File

@ -45,20 +45,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<attribute name="delete">0</attribute>
</tree>
<tree position="inside">
<field name="id" invisible="1" />
<field name="state" readonly="1" />
<button type="object" name="state_draft" string="Reset to draft"
icon="fa-arrow-up" attrs="{'invisible': [('state', '=', 'draft')]}"
icon="fa-arrow-up" attrs="{'invisible': ['|', ('id', '=', False), ('state', '=', 'draft')]}"
invisible="not context.get('action_show', 1)" />
<button type="object" name="state_confirm" string="Confirm"
icon="fa-check" attrs="{'invisible': [('state', '!=', 'draft')]}"
icon="fa-check" attrs="{'invisible': ['|', ('id', '=', False), ('state', '!=', 'draft')]}"
invisible="not context.get('action_show', 1)" />
<button type="object" name="state_cancel" string="Cancel"
icon="fa-ban" attrs="{'invisible': [('state', '=', 'canceled')]}"
icon="fa-ban" attrs="{'invisible': ['|', ('id', '=', False), ('state', '=', 'canceled')]}"
invisible="not context.get('action_show', 1)" />
<button type="object" name="state_remove" string="Remove"
icon="fa-trash"
confirm="Are you sure you want to remove this subscription ?"
attrs="{'invisible': [('state', '!=', 'canceled')]}"
attrs="{'invisible': ['|', ('id', '=', False), ('state', '!=', 'canceled')]}"
invisible="not context.get('action_show', 1)" />
</tree>
</field>

View File

@ -14,3 +14,5 @@
#
# 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

View File

@ -22,7 +22,7 @@
- New application on top menu ;
- Management of users and groups, companies ;
- Good default access / rights to do. ''',
'version': '10.0.0.1.0',
'version': '10.0.0.1.3',
'category': 'GOLEM',
'author': 'Fabien Bourgeois',
'license': 'AGPL-3',

View File

@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
# 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

View File

@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
# 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, api
class Partner(models.Model):
""" Partner adaptations """
_inherit = 'res.partner'
signup_token = fields.Char(groups="golem_base.group_golem_manager")
signup_type = fields.Char(groups="golem_base.group_golem_manager")
signup_expiration = fields.Datetime(groups="golem_base.group_golem_manager")
@api.multi
def write(self, vals):
""" Overwrite native function to workaround admin only write on fields
signup*, as it's impossible to overwrite groups attribute """
if (('signup_token' in vals or 'signup_type' in vals or
'signup_expiration' in vals)
and self.env.user.has_group('golem_base.group_golem_manager')):
return super(Partner, self.sudo()).write(vals)
return super(Partner, self).write(vals)

View File

@ -19,9 +19,9 @@
'name': 'GOLEM families',
'summary': 'GOLEM Members Families',
'description': 'GOLEM Members Families',
'version': '10.0.2.3.1',
'version': '10.0.2.4.0',
'category': 'GOLEM',
'author': 'Fabien Bourgeois',
'author': 'Fabien Bourgeois, Youssef El Ouahby',
'license': 'AGPL-3',
'application': False,
'installable': True,

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-01 10:12+0000\n"
"PO-Revision-Date: 2018-08-01 12:15+0200\n"
"POT-Creation-Date: 2018-10-19 07:03+0000\n"
"PO-Revision-Date: 2018-10-19 09:04+0200\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -145,8 +145,8 @@ msgid "Family"
msgstr "Famille"
#. module: golem_family
#: code:addons/golem_family/models/golem_family.py:50
#: code:addons/golem_family/models/golem_family.py:84
#: code:addons/golem_family/models/golem_family.py:49
#: code:addons/golem_family/models/golem_family.py:83
#, python-format
msgid "Family Members"
msgstr "Membres de la famille"
@ -308,6 +308,16 @@ msgstr "Role"
msgid "Roles"
msgstr "Roles"
#. module: golem_family
#: model:ir.model.fields,field_description:golem_family.field_golem_family_single_parent
msgid "Single parent"
msgstr "Monoparentale"
#. module: golem_family
#: model:ir.ui.view,arch_db:golem_family.golem_family_search
msgid "Single-parent"
msgstr "Monoparentale"
#. module: golem_family
#: model:ir.model.fields,field_description:golem_family.field_golem_family_state_id
#: model:ir.model.fields,field_description:golem_family.field_golem_member_family_state_id
@ -388,3 +398,4 @@ msgstr "membres"
#: model:ir.ui.view,arch_db:golem_family.golem_member_form_inherit_golem_family
msgid "name@example.org"
msgstr "name@example.org"

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-01 10:12+0000\n"
"PO-Revision-Date: 2018-08-01 10:12+0000\n"
"POT-Creation-Date: 2018-10-19 07:03+0000\n"
"PO-Revision-Date: 2018-10-19 07:03+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -145,8 +145,8 @@ msgid "Family"
msgstr ""
#. module: golem_family
#: code:addons/golem_family/models/golem_family.py:50
#: code:addons/golem_family/models/golem_family.py:84
#: code:addons/golem_family/models/golem_family.py:49
#: code:addons/golem_family/models/golem_family.py:83
#, python-format
msgid "Family Members"
msgstr ""
@ -308,6 +308,16 @@ msgstr ""
msgid "Roles"
msgstr ""
#. module: golem_family
#: model:ir.model.fields,field_description:golem_family.field_golem_family_single_parent
msgid "Single parent"
msgstr ""
#. module: golem_family
#: model:ir.ui.view,arch_db:golem_family.golem_family_search
msgid "Single-parent"
msgstr ""
#. module: golem_family
#: model:ir.model.fields,field_description:golem_family.field_golem_family_state_id
#: model:ir.model.fields,field_description:golem_family.field_golem_member_family_state_id

View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2017-2018 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2018 Youssef El Ouahby <youssef@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
@ -140,6 +141,7 @@ class GolemFamily(models.Model):
member_ids = fields.One2many('res.partner', 'family_id', 'Members',
domain=[('is_company', '=', False)])
single_parent = fields.Boolean()
note = fields.Text()
count = fields.Integer(compute='_compute_count', store=True)

View File

@ -2,6 +2,7 @@
<!--
Copyright 2017-2018 Fabien Bourgeois <fabien@yaltik.com>
Copyright 2018 Youssef El Ouahby <youssef@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
@ -36,6 +37,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</h1>
</div>
</group>
<group>
<field name="single_parent" />
</group>
<group string="Address">
<group>
<field name="street" placeholder="Street..." />
@ -187,6 +191,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="phone" />
<field name="mobile" />
<field name="email" />
<filter name="single_parent" string="Single-parent"
domain="[('single_parent', '=', True)]" />
<group string="Group By">
<filter name="group_city" string="By city"
context="{'group_by': 'city'}"/>

View File

@ -20,7 +20,7 @@
'name': 'GOLEM Family Memberships',
'summary': 'GOLEM Family Membership Management',
'description': 'GOLEM Family Membership Management',
'version': '10.0.0.1.0',
'version': '10.0.0.1.1',
'category': 'GOLEM',
'author': 'Fabien Bourgeois, Youssef ELOUAHBY',
'license': 'AGPL-3',

View File

@ -25,10 +25,9 @@ class GolemMembershipInvoice(models.TransientModel):
_inherit = 'golem.membership.invoice'
family_id = fields.Many2one('golem.family', string='Family',
required=True, ondelete='cascade')
ondelete='cascade')
member_ids = fields.Many2many('res.partner', string='Concerned members')
on_the_name_of = fields.Many2one('res.partner', ondelete='cascade',
required=True)
on_the_name_of = fields.Many2one('res.partner', ondelete='cascade')
@api.onchange('family_id')
def onchange_family(self):

View File

@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="member_ids" widget="many2many_tags"
options="{'no_create': True}" />
<field name="on_the_name_of" options="{'no_create': True}"
attrs="{'readonly': [('member_ids', '=', [])]}" />
attrs="{'readonly': [('member_ids', '=', [])], 'required': [('family_id', '!=', False)]}" />
<field name="product_id" domain="[('family_membership','=',True)]"
widget="selection" />
<field name="member_price" />

View File

@ -20,7 +20,7 @@
'name': 'GOLEM non-profit members',
'summary': 'Extends Odoo contacts for MJC',
'description': 'Extends Odoo contacts for MJC',
'version': '10.0.2.3.5',
'version': '10.0.2.4.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-27 09:04+0000\n"
"PO-Revision-Date: 2018-08-27 11:21+0200\n"
"POT-Creation-Date: 2018-10-22 16:02+0000\n"
"PO-Revision-Date: 2018-10-22 18:09+0200\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -72,6 +72,18 @@ msgstr "Appliquer pour les nouveaux adhérents"
msgid "Area"
msgstr "Territoire"
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_area_from_street
#: model:ir.model.fields,field_description:golem_member.field_res_partner_area_from_street
#: model:ir.model.fields,field_description:golem_member.field_res_users_area_from_street
msgid "Area from street"
msgstr "Territoire automatique depuis la rue"
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street_area_id
msgid "Area id"
msgstr "Territoire"
#. module: golem_member
#: model:ir.ui.view,arch_db:golem_member.golem_member_form
#: model:ir.ui.view,arch_db:golem_member.res_partner_form_inherit_golem_member
@ -295,6 +307,7 @@ msgstr "Faire de ce contact un usager"
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_create_uid
#: model:ir.model.fields,field_description:golem_member.field_golem_member_numberconfig_create_uid
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_create_uid
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street_create_uid
msgid "Created by"
msgstr "Créé par"
@ -303,6 +316,7 @@ msgstr "Créé par"
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_create_date
#: model:ir.model.fields,field_description:golem_member.field_golem_member_numberconfig_create_date
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_create_date
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street_create_date
msgid "Created on"
msgstr "Créé le"
@ -381,6 +395,7 @@ msgstr "Département"
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_display_name
#: model:ir.model.fields,field_description:golem_member.field_golem_member_numberconfig_display_name
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_display_name
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street_display_name
msgid "Display Name"
msgstr "Nom affiché"
@ -415,7 +430,7 @@ msgid "Fax"
msgstr "Fax"
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:57
#: code:addons/golem_member/models/golem_member.py:103
#, python-format
msgid "Female"
msgstr "Féminin"
@ -487,11 +502,16 @@ msgid "GOLEM Members Tags"
msgstr "Catégories d'adhérents"
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:360
#: code:addons/golem_member/models/golem_member.py:433
#, python-format
msgid "GOLEM Members merge has not been implemented yet. Please only merge partners, not members, or delete GOLEM Members manually before merging."
msgstr "La fusion d'adhérents n'a pas encore été implémentée. Merci de ne fusionner que des contacts non adhérents, ou bien de supprimer les adhérents manuellement en premier lieu."
#. module: golem_member
#: model:ir.model,name:golem_member.model_golem_partner_area_street
msgid "GOLEM Partner Area Street"
msgstr "GOLEM Partner Area Street"
#. module: golem_member
#: model:ir.model,name:golem_member.model_golem_season
msgid "GOLEM Season"
@ -537,6 +557,7 @@ msgstr "A des écritures non lettrées"
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_id
#: model:ir.model.fields,field_description:golem_member.field_golem_member_numberconfig_id
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_id
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street_id
msgid "ID"
msgstr "ID"
@ -677,6 +698,7 @@ msgstr "Langue"
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number___last_update
#: model:ir.model.fields,field_description:golem_member.field_golem_member_numberconfig___last_update
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area___last_update
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street___last_update
msgid "Last Modified on"
msgstr "Dernière Modification le"
@ -684,6 +706,7 @@ msgstr "Dernière Modification le"
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_write_uid
#: model:ir.model.fields,field_description:golem_member.field_golem_member_numberconfig_write_uid
#: model:ir.model.fields,field_description:golem_member.field_golem_member_write_uid
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street_write_uid
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_write_uid
msgid "Last Updated by"
msgstr "Dernière mise à jour par"
@ -692,6 +715,7 @@ msgstr "Dernière mise à jour par"
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_write_date
#: model:ir.model.fields,field_description:golem_member.field_golem_member_numberconfig_write_date
#: model:ir.model.fields,field_description:golem_member.field_golem_member_write_date
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street_write_date
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_write_date
msgid "Last Updated on"
msgstr "Dernière mise à jour le"
@ -712,7 +736,7 @@ msgid "Latest Invoices & Payments Matching Date"
msgstr "Date de dernière correspondance des factures et paiements"
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:57
#: code:addons/golem_member/models/golem_member.py:103
#, python-format
msgid "Male"
msgstr "Masculin"
@ -740,7 +764,7 @@ msgstr "Image de taille moyenne de ce contact. Elle est automatiquement redimens
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_member_id
msgid "Member"
msgstr "Adhérent"
msgstr "Usager"
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_name
@ -804,8 +828,9 @@ msgstr "NIC"
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_name
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_name_4301
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_name_4230
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_name
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street_name
msgid "Name"
msgstr "Nom"
@ -817,8 +842,8 @@ msgid "Nationality"
msgstr "Nationalité"
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:300
#: code:addons/golem_member/models/golem_member.py:303
#: code:addons/golem_member/models/golem_member.py:373
#: code:addons/golem_member/models/golem_member.py:376
#: selection:golem.member.numberconfig,is_automatic:0
#: selection:golem.member.numberconfig,is_per_season:0
#, python-format
@ -865,6 +890,16 @@ msgstr "Refuse les SMS ?"
msgid "Out of mailings?"
msgstr "Refuse la réception de mails ?"
#. module: golem_member
#: model:ir.ui.view,arch_db:golem_member.golem_partner_area_view_search
msgid "Parent"
msgstr "Parent"
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_parent_id
msgid "Parent Territory"
msgstr "Territoire parent"
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_parent_name
msgid "Parent name"
@ -949,6 +984,16 @@ msgstr "Date d'inscription"
msgid "Related Company"
msgstr "Société liée"
#. module: golem_member
#: model:ir.ui.view,arch_db:golem_member.golem_partner_area_view_search
msgid "Root Territories"
msgstr "Territoires racines"
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_root_id
msgid "Root area"
msgstr "Territoire racine"
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_siren
msgid "SIREN"
@ -1084,6 +1129,11 @@ msgstr "État"
msgid "Street"
msgstr "Rue"
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_area_street_ids
msgid "Street list"
msgstr "Liste de rues"
#. module: golem_member
#: model:ir.ui.view,arch_db:golem_member.golem_member_form
msgid "Street..."
@ -1092,7 +1142,12 @@ msgstr "Rue..."
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_street2
msgid "Street2"
msgstr "Complément de rue"
msgstr "Rue 2"
#. module: golem_member
#: model:ir.ui.view,arch_db:golem_member.golem_partner_area_view_search
msgid "Sub Territories"
msgstr "Sous-territoires"
#. module: golem_member
#: model:ir.actions.act_window,name:golem_member.golem_member_action
@ -1150,6 +1205,12 @@ msgstr "L'utilisateur interne qui est en charge de la communication avec ce cont
msgid "The name of official registry where this company was declared."
msgstr "Nom de la ville du tribunal de commerce dans laquelle la société est enregistrée."
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:69
#, python-format
msgid "The parent area is a sub area of the current area, please change it."
msgstr "Le territoire parent est un sous-territoire du territoire courant, merci de modifier vos saisies."
#. module: golem_member
#: model:ir.model.fields,help:golem_member.field_golem_member_has_unreconciled_entries
msgid "The partner has at least one unreconciled debit and credit since last time the invoices & payments matching was performed."
@ -1186,14 +1247,14 @@ msgid "This field holds the image used as avatar for this contact, limited to 10
msgstr "Ce champ contient l'image utilisée comme photo d'identité pour ce contact, limitée à 1024x1024px."
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:108
#: code:addons/golem_member/models/golem_member.py:168
#: sql_constraint:golem.member:0
#, python-format
msgid "This member number has already been used."
msgstr "Ce numéro d'adhérent a été déjà utilisé."
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:33
#: code:addons/golem_member/models/golem_member.py:47
#: sql_constraint:golem.partner.area:0
#, python-format
msgid "This patner area has already been used."
@ -1260,7 +1321,7 @@ msgid "Total amount you have to pay to this vendor."
msgstr "Montant total à payer au fournisseur."
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:175
#: code:addons/golem_member/models/golem_member.py:235
#, python-format
msgid "Unsupported operator for defautl season search"
msgstr "Opérateur de recherche non supporté pour le filtre de saison par défaut"
@ -1296,8 +1357,8 @@ msgid "Website of Partner or Company"
msgstr "Site Web pour les Partenaires ou les Sociétés"
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:300
#: code:addons/golem_member/models/golem_member.py:303
#: code:addons/golem_member/models/golem_member.py:373
#: code:addons/golem_member/models/golem_member.py:376
#: selection:golem.member.numberconfig,is_automatic:0
#: selection:golem.member.numberconfig,is_per_season:0
#, python-format

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-27 09:04+0000\n"
"PO-Revision-Date: 2018-08-27 09:04+0000\n"
"POT-Creation-Date: 2018-10-22 16:02+0000\n"
"PO-Revision-Date: 2018-10-22 16:02+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -72,6 +72,18 @@ msgstr ""
msgid "Area"
msgstr ""
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_area_from_street
#: model:ir.model.fields,field_description:golem_member.field_res_partner_area_from_street
#: model:ir.model.fields,field_description:golem_member.field_res_users_area_from_street
msgid "Area from street"
msgstr ""
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street_area_id
msgid "Area id"
msgstr ""
#. module: golem_member
#: model:ir.ui.view,arch_db:golem_member.golem_member_form
#: model:ir.ui.view,arch_db:golem_member.res_partner_form_inherit_golem_member
@ -295,6 +307,7 @@ msgstr ""
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_create_uid
#: model:ir.model.fields,field_description:golem_member.field_golem_member_numberconfig_create_uid
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_create_uid
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street_create_uid
msgid "Created by"
msgstr ""
@ -303,6 +316,7 @@ msgstr ""
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_create_date
#: model:ir.model.fields,field_description:golem_member.field_golem_member_numberconfig_create_date
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_create_date
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street_create_date
msgid "Created on"
msgstr ""
@ -381,6 +395,7 @@ msgstr ""
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_display_name
#: model:ir.model.fields,field_description:golem_member.field_golem_member_numberconfig_display_name
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_display_name
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street_display_name
msgid "Display Name"
msgstr ""
@ -415,7 +430,7 @@ msgid "Fax"
msgstr ""
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:57
#: code:addons/golem_member/models/golem_member.py:103
#, python-format
msgid "Female"
msgstr ""
@ -487,11 +502,16 @@ msgid "GOLEM Members Tags"
msgstr ""
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:360
#: code:addons/golem_member/models/golem_member.py:433
#, python-format
msgid "GOLEM Members merge has not been implemented yet. Please only merge partners, not members, or delete GOLEM Members manually before merging."
msgstr ""
#. module: golem_member
#: model:ir.model,name:golem_member.model_golem_partner_area_street
msgid "GOLEM Partner Area Street"
msgstr ""
#. module: golem_member
#: model:ir.model,name:golem_member.model_golem_season
msgid "GOLEM Season"
@ -537,6 +557,7 @@ msgstr ""
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_id
#: model:ir.model.fields,field_description:golem_member.field_golem_member_numberconfig_id
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_id
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street_id
msgid "ID"
msgstr ""
@ -671,6 +692,7 @@ msgstr ""
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number___last_update
#: model:ir.model.fields,field_description:golem_member.field_golem_member_numberconfig___last_update
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area___last_update
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street___last_update
msgid "Last Modified on"
msgstr ""
@ -678,6 +700,7 @@ msgstr ""
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_write_uid
#: model:ir.model.fields,field_description:golem_member.field_golem_member_numberconfig_write_uid
#: model:ir.model.fields,field_description:golem_member.field_golem_member_write_uid
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street_write_uid
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_write_uid
msgid "Last Updated by"
msgstr ""
@ -686,6 +709,7 @@ msgstr ""
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_write_date
#: model:ir.model.fields,field_description:golem_member.field_golem_member_numberconfig_write_date
#: model:ir.model.fields,field_description:golem_member.field_golem_member_write_date
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street_write_date
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_write_date
msgid "Last Updated on"
msgstr ""
@ -706,7 +730,7 @@ msgid "Latest Invoices & Payments Matching Date"
msgstr ""
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:57
#: code:addons/golem_member/models/golem_member.py:103
#, python-format
msgid "Male"
msgstr ""
@ -798,8 +822,9 @@ msgstr ""
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_name
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_name_4301
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_name_4230
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_name
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street_name
msgid "Name"
msgstr ""
@ -811,8 +836,8 @@ msgid "Nationality"
msgstr ""
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:300
#: code:addons/golem_member/models/golem_member.py:303
#: code:addons/golem_member/models/golem_member.py:373
#: code:addons/golem_member/models/golem_member.py:376
#: selection:golem.member.numberconfig,is_automatic:0
#: selection:golem.member.numberconfig,is_per_season:0
#, python-format
@ -859,6 +884,16 @@ msgstr ""
msgid "Out of mailings?"
msgstr ""
#. module: golem_member
#: model:ir.ui.view,arch_db:golem_member.golem_partner_area_view_search
msgid "Parent"
msgstr ""
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_parent_id
msgid "Parent Territory"
msgstr ""
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_parent_name
msgid "Parent name"
@ -941,6 +976,16 @@ msgstr ""
msgid "Related Company"
msgstr ""
#. module: golem_member
#: model:ir.ui.view,arch_db:golem_member.golem_partner_area_view_search
msgid "Root Territories"
msgstr ""
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_root_id
msgid "Root area"
msgstr ""
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_siren
msgid "SIREN"
@ -1076,6 +1121,11 @@ msgstr ""
msgid "Street"
msgstr ""
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_area_street_ids
msgid "Street list"
msgstr ""
#. module: golem_member
#: model:ir.ui.view,arch_db:golem_member.golem_member_form
msgid "Street..."
@ -1086,6 +1136,11 @@ msgstr ""
msgid "Street2"
msgstr ""
#. module: golem_member
#: model:ir.ui.view,arch_db:golem_member.golem_partner_area_view_search
msgid "Sub Territories"
msgstr ""
#. module: golem_member
#: model:ir.actions.act_window,name:golem_member.golem_member_action
#: model:ir.ui.menu,name:golem_member.golem_members_menu
@ -1142,6 +1197,12 @@ msgstr ""
msgid "The name of official registry where this company was declared."
msgstr ""
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:69
#, python-format
msgid "The parent area is a sub area of the current area, please change it."
msgstr ""
#. module: golem_member
#: model:ir.model.fields,help:golem_member.field_golem_member_has_unreconciled_entries
msgid "The partner has at least one unreconciled debit and credit since last time the invoices & payments matching was performed."
@ -1178,14 +1239,14 @@ msgid "This field holds the image used as avatar for this contact, limited to 10
msgstr ""
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:108
#: code:addons/golem_member/models/golem_member.py:168
#: sql_constraint:golem.member:0
#, python-format
msgid "This member number has already been used."
msgstr ""
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:33
#: code:addons/golem_member/models/golem_member.py:47
#: sql_constraint:golem.partner.area:0
#, python-format
msgid "This patner area has already been used."
@ -1252,7 +1313,7 @@ msgid "Total amount you have to pay to this vendor."
msgstr ""
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:175
#: code:addons/golem_member/models/golem_member.py:235
#, python-format
msgid "Unsupported operator for defautl season search"
msgstr ""
@ -1288,8 +1349,8 @@ msgid "Website of Partner or Company"
msgstr ""
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:300
#: code:addons/golem_member/models/golem_member.py:303
#: code:addons/golem_member/models/golem_member.py:373
#: code:addons/golem_member/models/golem_member.py:376
#: selection:golem.member.numberconfig,is_automatic:0
#: selection:golem.member.numberconfig,is_per_season:0
#, python-format

View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
#
# Copyright 2016-2018 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2018 Youssef El Ouahby <youssef@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
@ -19,9 +20,22 @@
import logging
from odoo import models, fields, api, _
from odoo.exceptions import UserError
from odoo.exceptions import UserError, ValidationError
_LOGGER = logging.getLogger(__name__)
def get_root_area(area_id):
""" Get root area """
if not area_id.parent_id:
return area_id
return get_root_area(area_id.parent_id)
def is_sub_area(area_id, parent_id):
""" Check if parent is sub area """
if parent_id.parent_id.id == area_id.id:
return True
if not parent_id.parent_id:
return False
return is_sub_area(area_id, parent_id.parent_id)
class PartnerArea(models.Model):
""" Partner Area """
@ -34,6 +48,37 @@ class PartnerArea(models.Model):
name = fields.Char(required=True, index=True)
sequence = fields.Integer()
area_street_ids = fields.One2many('golem.partner.area.street', 'area_id',
string='Street list')
parent_id = fields.Many2one('golem.partner.area', string='Parent Territory',
domain="[('id', '!=', id)]")
root_id = fields.Many2one('golem.partner.area', compute='_compute_root_id',
string='Root area')
@api.depends('parent_id')
def _compute_root_id(self):
""" Compute root_id """
for area in self:
area.root_id = get_root_area(area)
@api.constrains('parent_id')
def check_parent_id(self):
""" Check if parent is sub area """
for area in self:
if is_sub_area(area, area.parent_id):
err = _('The parent area is a sub area of the current area, '
'please change it.')
raise ValidationError(err)
class GolemPartnerAreaStreet(models.Model):
""" GOLEM Partner Area Street Management """
_name = 'golem.partner.area.street'
_description = 'GOLEM Partner Area Street'
name = fields.Char(required=True)
area_id = fields.Many2one('golem.partner.area', required=True, sring='Area',
index=True, auto_join=True, ondelete='set null')
class ResPartner(models.Model):
@ -51,6 +96,7 @@ class ResPartner(models.Model):
'golem.partner.area', index=True, auto_join=True, string='Area',
help="Area, quarter... for statistics and activity price."
)
area_from_street = fields.Boolean(store=False, default=False)
country_id = fields.Many2one(default=_get_default_nationality_id)
# Gender overwriting : no need for 'other' choice
@ -83,6 +129,20 @@ class ResPartner(models.Model):
gm_obj = self.env['golem.member']
gm_obj.create({'partner_id': self[0].id})
@api.constrains('street')
def save_street(self):
""" Save street if no exist """
for member in self:
if member.street and not member.area_from_street:
mstreet = member.street.strip()
street_id = self.env['golem.partner.area.street'].search(
[('name', 'ilike', mstreet)]
)
if not street_id:
self.env['golem.partner.area.street'].create(
{'name': mstreet, 'area_id': member.area_id.id}
)
class GolemMembershipInvoice(models.TransientModel):
""" GOLEM Membership Invoice adaptations """
_inherit = 'golem.membership.invoice'
@ -182,6 +242,19 @@ class GolemMember(models.Model):
is_num_man = (conf.get_param('golem_numberconfig_isautomatic') == '0')
self.update({'is_number_manual': is_num_man})
@api.onchange('street')
def onchange_street(self):
""" Area auto assignement """
for member in self:
mstreet = member.street.strip() if member.street else False
if mstreet and not member.area_id:
street_id = self.env['golem.partner.area.street'].search(
[('name', 'ilike', mstreet)], limit=1
)
if street_id:
member.area_id = street_id.area_id
member.area_from_street = True
@api.multi
def generate_number_perseason(self):
""" Number generation in case of per season configuration """
@ -250,10 +323,10 @@ class GolemMember(models.Model):
member.number = member.generate_number_global()
@api.multi
def write(self, values):
def write(self, vals):
""" Number generation after updates """
res = super(GolemMember, self).write(values)
if 'season_ids' in values or 'number_manual' in values:
res = super(GolemMember, self).write(vals)
if 'season_ids' in vals or 'number_manual' in vals:
self.generate_number()
return res

View File

@ -1,5 +1,6 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_golem_member_user,Access GOLEM Member User,model_golem_member,golem_base.group_golem_user,1,1,1,1
access_partner_area_user,Access GOLEM Partner Area User,model_golem_partner_area,golem_base.group_golem_user,1,1,1,1
access_partner_area_street_user,Access GOLEM Partner Area Street User,model_golem_partner_area_street,golem_base.group_golem_user,1,1,1,1
access_golem_member_season_user,Access GOLEM Member Season User,model_golem_member_number,golem_base.group_golem_user,1,1,1,1
access_ir_config_parameter_manager,Access IR Config Parameter Manager,base.model_ir_config_parameter,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_member_user Access GOLEM Member User model_golem_member golem_base.group_golem_user 1 1 1 1
3 access_partner_area_user Access GOLEM Partner Area User model_golem_partner_area golem_base.group_golem_user 1 1 1 1
4 access_partner_area_street_user Access GOLEM Partner Area Street User model_golem_partner_area_street golem_base.group_golem_user 1 1 1 1
5 access_golem_member_season_user Access GOLEM Member Season User model_golem_member_number golem_base.group_golem_user 1 1 1 1
6 access_ir_config_parameter_manager Access IR Config Parameter Manager base.model_ir_config_parameter golem_base.group_golem_manager 1 1 1 1

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
Copyright 2018 Youssef El Ouahby <youssef@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
@ -24,13 +25,40 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="name">GOLEM Partner Area Tree</field>
<field name="model">golem.partner.area</field>
<field name="arch" type="xml">
<tree editable="bottom">
<tree>
<field name="sequence" widget="handle" />
<field name="name" />
<field name="parent_id"/>
</tree>
</field>
</record>
<!-- Form -->
<record model="ir.ui.view" id="golem_partner_area_view_form">
<field name="name">GOLEM Partner Area Form</field>
<field name="model">golem.partner.area</field>
<field name="arch" type="xml">
<form>
<group>
<group>
<field name="name" />
</group>
<group>
<field name="parent_id" />
<field name="root_id" />
</group>
</group>
<group>
<field name="area_street_ids">
<tree editable="bottom">
<field name="name" />
</tree>
</field>
</group>
</form>
</field>
</record>
<!-- Search -->
<record id="golem_partner_area_view_search" model="ir.ui.view">
<field name="name">GOLEM Partner Area Search</field>
@ -38,13 +66,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="arch" type="xml">
<search>
<field name="name" />
<field name="parent_id" />
<filter name="sub_territories" string="Sub Territories"
domain="[('parent_id', '!=', False)]" />
<filter name="root_territories" string="Root Territories"
domain="[('parent_id', '=', False)]" />
<filter name="group_parent" string="Parent"
context="{'group_by': 'parent_id'}" />
</search>
</field>
</record>
<!-- Actions -->
<act_window id="golem_partner_area_action"
name="Areas" res_model="golem.partner.area" view_mode="tree" />
<act_window id="golem_partner_area_action" name="Areas"
res_model="golem.partner.area" view_mode="tree,form" />
<!-- Menus -->
<menuitem id="golem_partner_area_menu" name="Areas"

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>