[REF]Huge refactoring around is_current / default season

Not computed anymore
Replaced is_current by more coherent is_default
Not seen current season only per default.
This commit is contained in:
Fabien BOURGEOIS 2018-07-20 10:09:24 +02:00
parent 824f187fce
commit c18b0a20a7
32 changed files with 310 additions and 234 deletions

View File

@ -19,7 +19,7 @@
'name': 'GOLEM activities', 'name': 'GOLEM activities',
'summary': 'Extends Odoo products for multi-activity', 'summary': 'Extends Odoo products for multi-activity',
'description': 'Extends Odoo products for multi-activity', 'description': 'Extends Odoo products for multi-activity',
'version': '10.0.2.3.2', 'version': '10.0.2.4.0',
'category': 'GOLEM', 'category': 'GOLEM',
'author': 'Fabien Bourgeois, Michel Dessenne', 'author': 'Fabien Bourgeois, Michel Dessenne',
'license': 'AGPL-3', 'license': 'AGPL-3',

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-17 08:44+0000\n" "POT-Creation-Date: 2018-07-20 07:46+0000\n"
"PO-Revision-Date: 2018-07-17 10:44+0200\n" "PO-Revision-Date: 2018-07-20 10:04+0200\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -173,13 +173,13 @@ msgid "Activity audience"
msgstr "Public" msgstr "Public"
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:142 #: code:addons/golem_activity/models/golem_activity.py:157
#, python-format #, python-format
msgid "Activity end date can not be set after linked season end." msgid "Activity end date can not be set after linked season end."
msgstr "La date de fin ne peut pas être apprêt la date de fin de la saison." msgstr "La date de fin ne peut pas être apprêt la date de fin de la saison."
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:138 #: code:addons/golem_activity/models/golem_activity.py:153
#, python-format #, python-format
msgid "Activity start date can not be set before linked season start." msgid "Activity start date can not be set before linked season start."
msgstr "La date de début ne peut pas être avant la date de début de la saison." msgstr "La date de début ne peut pas être avant la date de début de la saison."
@ -319,11 +319,6 @@ msgstr "Créé le"
msgid "Currency" msgid "Currency"
msgstr "Devise" msgstr "Devise"
#. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_is_current
msgid "Current season?"
msgstr "Saison en cours?"
#. module: golem_activity #. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_taxes_id #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_taxes_id
msgid "Customer Taxes" msgid "Customer Taxes"
@ -369,6 +364,11 @@ msgstr "Unité de mesure par défaut pour les ordres d'achat. Elle doit apparten
msgid "Default season" msgid "Default season"
msgstr "Saison par défaut" msgstr "Saison par défaut"
#. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_is_default
msgid "Default season?"
msgstr "Saison par défaut?"
#. module: golem_activity #. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_description #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_description
msgid "Description" msgid "Description"
@ -392,7 +392,7 @@ msgid "Expense Account"
msgstr "Compte de dépenses" msgstr "Compte de dépenses"
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:160 #: code:addons/golem_activity/models/golem_activity.py:175
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Friday" msgid "Friday"
@ -563,7 +563,7 @@ msgid "Membership Start Date"
msgstr "Date de début d'adhésion" msgstr "Date de début d'adhésion"
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:156 #: code:addons/golem_activity/models/golem_activity.py:171
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Monday" msgid "Monday"
@ -657,7 +657,7 @@ msgid "Sale Price"
msgstr "Prix de vente" msgstr "Prix de vente"
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:161 #: code:addons/golem_activity/models/golem_activity.py:176
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Saturday" msgid "Saturday"
@ -710,8 +710,8 @@ msgid "Start date"
msgstr "Date de début" msgstr "Date de début"
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:135 #: code:addons/golem_activity/models/golem_activity.py:150
#: code:addons/golem_activity/models/golem_activity.py:178 #: code:addons/golem_activity/models/golem_activity.py:193
#, python-format #, python-format
msgid "Start of the period cannot be after end of the period." msgid "Start of the period cannot be after end of the period."
msgstr "Le début de la période ne peut être antérieure à sa fin" msgstr "Le début de la période ne peut être antérieure à sa fin"
@ -727,7 +727,7 @@ msgid "Stop time"
msgstr "Heure de fin" msgstr "Heure de fin"
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:162 #: code:addons/golem_activity/models/golem_activity.py:177
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Sunday" msgid "Sunday"
@ -778,7 +778,7 @@ msgid "This field holds the image used as image for the activity."
msgstr "This field holds the image used as image for the activity." msgstr "This field holds the image used as image for the activity."
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:159 #: code:addons/golem_activity/models/golem_activity.py:174
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Thursday" msgid "Thursday"
@ -795,7 +795,7 @@ msgid "True"
msgstr "True" msgstr "True"
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:157 #: code:addons/golem_activity/models/golem_activity.py:172
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Tuesday" msgid "Tuesday"
@ -812,6 +812,12 @@ msgstr "Type"
msgid "Unit of Measure" msgid "Unit of Measure"
msgstr "Unité de mesure" msgstr "Unité de mesure"
#. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:123
#, python-format
msgid "Unsupported operator for defautl season search"
msgstr "Opérateur de recherche non supporté pour le filtre de la saison par défaut"
#. module: golem_activity #. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_supplier_taxes_id #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_supplier_taxes_id
msgid "Vendor Taxes" msgid "Vendor Taxes"
@ -833,7 +839,7 @@ msgid "Warranty"
msgstr "Garantie" msgstr "Garantie"
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:158 #: code:addons/golem_activity/models/golem_activity.py:173
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Wednesday" msgid "Wednesday"

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-17 08:44+0000\n" "POT-Creation-Date: 2018-07-20 07:46+0000\n"
"PO-Revision-Date: 2018-07-17 08:44+0000\n" "PO-Revision-Date: 2018-07-20 07:46+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -170,13 +170,13 @@ msgid "Activity audience"
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:142 #: code:addons/golem_activity/models/golem_activity.py:157
#, python-format #, python-format
msgid "Activity end date can not be set after linked season end." msgid "Activity end date can not be set after linked season end."
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:138 #: code:addons/golem_activity/models/golem_activity.py:153
#, python-format #, python-format
msgid "Activity start date can not be set before linked season start." msgid "Activity start date can not be set before linked season start."
msgstr "" msgstr ""
@ -316,11 +316,6 @@ msgstr ""
msgid "Currency" msgid "Currency"
msgstr "" msgstr ""
#. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_is_current
msgid "Current season?"
msgstr ""
#. module: golem_activity #. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_taxes_id #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_taxes_id
msgid "Customer Taxes" msgid "Customer Taxes"
@ -366,6 +361,11 @@ msgstr ""
msgid "Default season" msgid "Default season"
msgstr "" msgstr ""
#. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_is_default
msgid "Default season?"
msgstr ""
#. module: golem_activity #. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_description #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_description
msgid "Description" msgid "Description"
@ -389,7 +389,7 @@ msgid "Expense Account"
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:160 #: code:addons/golem_activity/models/golem_activity.py:175
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Friday" msgid "Friday"
@ -560,7 +560,7 @@ msgid "Membership Start Date"
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:156 #: code:addons/golem_activity/models/golem_activity.py:171
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Monday" msgid "Monday"
@ -654,7 +654,7 @@ msgid "Sale Price"
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:161 #: code:addons/golem_activity/models/golem_activity.py:176
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Saturday" msgid "Saturday"
@ -707,8 +707,8 @@ msgid "Start date"
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:135 #: code:addons/golem_activity/models/golem_activity.py:150
#: code:addons/golem_activity/models/golem_activity.py:178 #: code:addons/golem_activity/models/golem_activity.py:193
#, python-format #, python-format
msgid "Start of the period cannot be after end of the period." msgid "Start of the period cannot be after end of the period."
msgstr "" msgstr ""
@ -724,7 +724,7 @@ msgid "Stop time"
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:162 #: code:addons/golem_activity/models/golem_activity.py:177
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Sunday" msgid "Sunday"
@ -775,7 +775,7 @@ msgid "This field holds the image used as image for the activity."
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:159 #: code:addons/golem_activity/models/golem_activity.py:174
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Thursday" msgid "Thursday"
@ -792,7 +792,7 @@ msgid "True"
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:157 #: code:addons/golem_activity/models/golem_activity.py:172
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Tuesday" msgid "Tuesday"
@ -809,6 +809,12 @@ msgstr ""
msgid "Unit of Measure" msgid "Unit of Measure"
msgstr "" msgstr ""
#. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:123
#, python-format
msgid "Unsupported operator for defautl season search"
msgstr ""
#. module: golem_activity #. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_supplier_taxes_id #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_supplier_taxes_id
msgid "Vendor Taxes" msgid "Vendor Taxes"
@ -830,7 +836,7 @@ msgid "Warranty"
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:158 #: code:addons/golem_activity/models/golem_activity.py:173
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Wednesday" msgid "Wednesday"

View File

@ -61,7 +61,8 @@ class GolemActivity(models.Model):
is_fullseason = fields.Boolean('Is full season?', is_fullseason = fields.Boolean('Is full season?',
compute='_compute_is_full_season') compute='_compute_is_full_season')
location = fields.Char() location = fields.Char()
audience_id = fields.Many2one('golem.activity.audience', string='Audience') audience_id = fields.Many2one('golem.activity.audience', string='Audience',
index=True, auto_join=True)
@api.onchange('is_fullseason') @api.onchange('is_fullseason')
def onchange_fullseason(self): def onchange_fullseason(self):
@ -91,29 +92,43 @@ class GolemActivity(models.Model):
activity.full_name = full_name activity.full_name = full_name
@api.model @api.model
def _default_season(self): def default_season(self):
""" Get default season """ """ Get default season """
domain = [('is_default', '=', True)] domain = [('is_default', '=', True)]
return self.env['golem.season'].search(domain) return self.env['golem.season'].search(domain)
season_id = fields.Many2one('golem.season', string='Season', copy=False, season_id = fields.Many2one('golem.season', string='Season', copy=False,
required=True, default=_default_season, required=True, default=default_season,
index=True, auto_join=True,
ondelete='restrict') ondelete='restrict')
is_default = fields.Boolean('Default season?',
is_current = fields.Boolean('Current season?', store=True, default=False, compute='_compute_is_default',
compute='_compute_is_current') search='_search_is_default')
@api.depends('season_id') @api.depends('season_id')
def _compute_is_current(self): def _compute_is_default(self):
""" Checks if activity is active for current season """ """ Checks if activity is active for default season """
default_season = self._default_season() default_season = self.default_season()
for activity in self: for activity in self:
activity.is_current = (default_season == activity.season_id) activity.is_default = (default_season == activity.season_id)
@api.multi
def _search_is_default(self, operator, value):
""" Search function for is default """
if operator in ('in', '='):
operator = '=' if value else '!='
elif operator in ('not in', '!='):
operator = '!=' if value else '='
else:
err = _('Unsupported operator for defautl season search')
raise NotImplementedError(err)
return [('season_id', operator, self.default_season().id)]
animator_id = fields.Many2one('res.partner', string='Animator', animator_id = fields.Many2one('res.partner', string='Animator',
index=True, auto_join=True,
domain=[('is_company', '=', False)]) domain=[('is_company', '=', False)])
type_id = fields.Many2one('golem.activity.type', required=True, index=True, type_id = fields.Many2one('golem.activity.type', required=True, index=True,
string='Type') auto_join=True, string='Type')
is_recurrent = fields.Boolean(related='type_id.is_recurrent') is_recurrent = fields.Boolean(related='type_id.is_recurrent')
date_start = fields.Date('Start date', copy=False) date_start = fields.Date('Start date', copy=False)
date_stop = fields.Date('End date', copy=False) date_stop = fields.Date('End date', copy=False)

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright 2016 Fabien Bourgeois <fabien@yaltik.com> # Copyright 2016-2018 Fabien Bourgeois <fabien@yaltik.com>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -40,7 +40,7 @@ class GolemActivityTestCase(TransactionCase):
self.assertEqual(a1.name, 'a1') self.assertEqual(a1.name, 'a1')
self.assertEqual(a1.date_start, self.season_current.date_start) self.assertEqual(a1.date_start, self.season_current.date_start)
self.assertEqual(a1.date_end, self.season_current.date_end) self.assertEqual(a1.date_end, self.season_current.date_end)
self.assertTrue(a1.is_current) self.assertTrue(a1.is_default)
adata.update({'name': 'a2', 'date_start': '2010-01-01', adata.update({'name': 'a2', 'date_start': '2010-01-01',
'date_end': '2009-12-01'}) 'date_end': '2009-12-01'})
with self.assertRaises(ValidationError): with self.assertRaises(ValidationError):

View File

@ -169,7 +169,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="categ_id" /> <field name="categ_id" />
<field name="season_id" /> <field name="season_id" />
<filter name="season_default" string="Default season" <filter name="season_default" string="Default season"
domain="[('is_current', '=', True)]" /> domain="[('is_default', '=', True)]" />
<group string="Group By"> <group string="Group By">
<filter name="group_type_id" string="By type" <filter name="group_type_id" string="By type"
context="{'group_by': 'type_id'}" /> context="{'group_by': 'type_id'}" />
@ -186,8 +186,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<!-- Actions --> <!-- Actions -->
<act_window id="golem_activity_action" name="GOLEM Activities" <act_window id="golem_activity_action" name="GOLEM Activities"
res_model="golem.activity" view_mode="tree,form,calendar" res_model="golem.activity" view_mode="tree,form,calendar" />
context="{'search_default_season_default': True}" />
<act_window id="golem_activity_type_action" name="GOLEM Activity Types" <act_window id="golem_activity_type_action" name="GOLEM Activity Types"
res_model="golem.activity.type" view_mode="tree" /> res_model="golem.activity.type" view_mode="tree" />
<act_window id="golem_activity_audience_action" name="GOLEM Activity Audiences" <act_window id="golem_activity_audience_action" name="GOLEM Activity Audiences"

View File

@ -20,7 +20,7 @@
'name': 'GOLEM activity queues', 'name': 'GOLEM activity queues',
'summary': 'GOLEM activity queues', 'summary': 'GOLEM activity queues',
'description': ''' GOLEM activity queue management ''', 'description': ''' GOLEM activity queue management ''',
'version': '10.0.1.2.3', 'version': '10.0.1.3.0',
'category': 'GOLEM', 'category': 'GOLEM',
'author': 'Youssef El Ouahby, Fabien Bourgeois', 'author': 'Youssef El Ouahby, Fabien Bourgeois',
'license': 'AGPL-3', 'license': 'AGPL-3',

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-07 18:55+0000\n" "POT-Creation-Date: 2018-07-20 07:46+0000\n"
"PO-Revision-Date: 2018-03-07 18:55+0000\n" "PO-Revision-Date: 2018-07-20 10:05+0200\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -98,16 +98,16 @@ msgstr "Créé par"
msgid "Created on" msgid "Created on"
msgstr "Créé le" msgstr "Créé le"
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_is_current
msgid "Current season?"
msgstr "Saison en cours?"
#. module: golem_activity_queue #. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_queue_view_search #: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_queue_view_search
msgid "Default season" msgid "Default season"
msgstr "Saison par défaut" msgstr "Saison par défaut"
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_is_default
msgid "Default season?"
msgstr "Saison par défaut?"
#. module: golem_activity_queue #. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_automated_queue_activate_wizard_display_name #: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_automated_queue_activate_wizard_display_name
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_display_name #: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_display_name
@ -247,7 +247,7 @@ msgid "Switch to manual registration from queue"
msgstr "Passer à une inscription manuelle depuis la liste d'attente" msgstr "Passer à une inscription manuelle depuis la liste d'attente"
#. module: golem_activity_queue #. module: golem_activity_queue
#: code:addons/golem_activity_queue/models/golem_activity_queue.py:52 #: code:addons/golem_activity_queue/models/golem_activity_queue.py:51
#, python-format #, python-format
msgid "The member your trying to add to the queue is already registered for this activity" msgid "The member your trying to add to the queue is already registered for this activity"
msgstr "L'adhérent que vous essayez d'ajouter à la liste d'attente est déjà inscrit à cette activité" msgstr "L'adhérent que vous essayez d'ajouter à la liste d'attente est déjà inscrit à cette activité"
@ -289,3 +289,4 @@ msgstr "Attention"
#: model:ir.model,name:golem_activity_queue.model_golem_activity_automated_queue_activate_wizard #: model:ir.model,name:golem_activity_queue.model_golem_activity_automated_queue_activate_wizard
msgid "golem.activity.automated.queue.activate.wizard" msgid "golem.activity.automated.queue.activate.wizard"
msgstr "golem.activity.automated.queue.activate.wizard" msgstr "golem.activity.automated.queue.activate.wizard"

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-07 18:54+0000\n" "POT-Creation-Date: 2018-07-20 07:46+0000\n"
"PO-Revision-Date: 2018-03-07 18:54+0000\n" "PO-Revision-Date: 2018-07-20 07:46+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -98,13 +98,13 @@ msgid "Created on"
msgstr "" msgstr ""
#. module: golem_activity_queue #. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_is_current #: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_queue_view_search
msgid "Current season?" msgid "Default season"
msgstr "" msgstr ""
#. module: golem_activity_queue #. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_queue_view_search #: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_is_default
msgid "Default season" msgid "Default season?"
msgstr "" msgstr ""
#. module: golem_activity_queue #. module: golem_activity_queue
@ -246,7 +246,7 @@ msgid "Switch to manual registration from queue"
msgstr "" msgstr ""
#. module: golem_activity_queue #. module: golem_activity_queue
#: code:addons/golem_activity_queue/models/golem_activity_queue.py:52 #: code:addons/golem_activity_queue/models/golem_activity_queue.py:51
#, python-format #, python-format
msgid "The member your trying to add to the queue is already registered for this activity" msgid "The member your trying to add to the queue is already registered for this activity"
msgstr "" msgstr ""

View File

@ -36,8 +36,7 @@ class GolemActivityQueue(models.Model):
string='Activity', ondelete='cascade', string='Activity', ondelete='cascade',
index=True) index=True)
season_id = fields.Many2one(related='activity_id.season_id') season_id = fields.Many2one(related='activity_id.season_id')
is_current = fields.Boolean('Current season?', is_default = fields.Boolean(related='activity_id.is_default')
related='activity_id.is_current', store=True)
places_remain = fields.Integer(related='activity_id.places_remain') places_remain = fields.Integer(related='activity_id.places_remain')
sequence = fields.Integer() sequence = fields.Integer()

View File

@ -47,7 +47,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="activity_id"/> <field name="activity_id"/>
<field name="season_id" /> <field name="season_id" />
<filter name="season_default" string="Default season" <filter name="season_default" string="Default season"
domain="[('is_current', '=', True)]" /> domain="[('is_default', '=', True)]" />
<separator /> <separator />
<filter name="activity_full" string="Full Activity" <filter name="activity_full" string="Full Activity"
domain="[('places_remain', '=', 0)]" /> domain="[('places_remain', '=', 0)]" />
@ -73,7 +73,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="sequence" widget="handle"/> <field name="sequence" widget="handle"/>
<field name="member_id"/> <field name="member_id"/>
<field name="activity_id" <field name="activity_id"
domain="[('places_remain','&lt;' , 1), ('queue_allowed', '=', True), ('is_current', '=', True)]" domain="[('places_remain','&lt;' , 1), ('queue_allowed', '=', True), ('is_default', '=', True)]"
options="{'no_create': True}"/> options="{'no_create': True}"/>
<field name="season_id" readonly='1'/> <field name="season_id" readonly='1'/>
<field name="create_date" readonly="1"/> <field name="create_date" readonly="1"/>
@ -84,8 +84,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<!-- Action --> <!-- Action -->
<act_window id="golem_activity_queue_action" name="Activity queue" <act_window id="golem_activity_queue_action" name="Activity queue"
res_model="golem.activity.queue" view_mode="tree" res_model="golem.activity.queue" view_mode="tree" />
context="{'search_default_season_default': True}" />
<!-- Menu --> <!-- Menu -->
<menuitem id="golem_activity_queue_menu" name="Activity queue" <menuitem id="golem_activity_queue_menu" name="Activity queue"

View File

@ -35,7 +35,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<tree editable="top"> <tree editable="top">
<field name="sequence" widget="handle"/> <field name="sequence" widget="handle"/>
<field name="activity_id" <field name="activity_id"
domain="[('places_remain','&lt;' , 1), ('queue_allowed', '=', True), ('is_current', '=', True)]" domain="[('places_remain','&lt;' , 1), ('queue_allowed', '=', True), ('is_default', '=', True)]"
options="{'no_create': True}"/> options="{'no_create': True}"/>
<field name="season_id" readonly="1" /> <field name="season_id" readonly="1" />
</tree> </tree>

View File

@ -18,7 +18,7 @@
{ {
'name': 'GOLEM Activity Member Registrations', 'name': 'GOLEM Activity Member Registrations',
'summary': 'GOLEM Activities Member Registrations management', 'summary': 'GOLEM Activities Member Registrations management',
'version': '10.0.1.2.1', 'version': '10.0.1.3.0',
'category': 'GOLEM', 'category': 'GOLEM',
'author': 'Fabien Bourgeois, Michel Dessenne', 'author': 'Fabien Bourgeois, Michel Dessenne',
'license': 'AGPL-3', 'license': 'AGPL-3',

View File

@ -6,15 +6,14 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-12 14:17+0000\n" "POT-Creation-Date: 2018-07-20 07:46+0000\n"
"PO-Revision-Date: 2018-06-12 16:18+0200\n" "PO-Revision-Date: 2018-07-20 10:07+0200\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
"Language: fr\n" "Plural-Forms: \n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#. module: golem_activity_registration #. module: golem_activity_registration
#: model:ir.ui.view,arch_db:golem_activity_registration.golem_activity_report_template_inherited_golem_activity_registration #: model:ir.ui.view,arch_db:golem_activity_registration.golem_activity_report_template_inherited_golem_activity_registration
@ -38,7 +37,7 @@ msgstr "<i class=\"fa fa-university\"/>Ville"
#. module: golem_activity_registration #. module: golem_activity_registration
#: model:ir.ui.view,arch_db:golem_activity_registration.golem_activity_report_template_inherited_golem_activity_registration #: model:ir.ui.view,arch_db:golem_activity_registration.golem_activity_report_template_inherited_golem_activity_registration
msgid "<i class=\"fa fa-user\"/>Name" msgid "<i class=\"fa fa-user\"/> Name"
msgstr "<i class=\"fa fa-user\"/>Nom" msgstr "<i class=\"fa fa-user\"/>Nom"
#. module: golem_activity_registration #. module: golem_activity_registration
@ -47,6 +46,11 @@ msgstr "<i class=\"fa fa-user\"/>Nom"
msgid "Activities" msgid "Activities"
msgstr "Activités" msgstr "Activités"
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_member_activity_registration_ids
msgid "Activities for default season"
msgstr "Activités de la saison par défaut"
#. module: golem_activity_registration #. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_registration_activity_id #: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_registration_activity_id
msgid "Activity" msgid "Activity"
@ -92,16 +96,6 @@ msgstr "Créé par"
msgid "Created on" msgid "Created on"
msgstr "Créé le" msgstr "Créé le"
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_member_activity_registration_ids
msgid "Current activities"
msgstr "Activités de la saison affichée par défaut"
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_registration_is_current
msgid "Current season?"
msgstr "Saison en cours?"
#. module: golem_activity_registration #. module: golem_activity_registration
#: model:ir.ui.view,arch_db:golem_activity_registration.golem_member_card_template_inherit_golem_activity_resgitration #: model:ir.ui.view,arch_db:golem_activity_registration.golem_member_card_template_inherit_golem_activity_resgitration
msgid "Date start" msgid "Date start"
@ -209,7 +203,7 @@ msgid "Name"
msgstr "Nom" msgstr "Nom"
#. module: golem_activity_registration #. module: golem_activity_registration
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:38 #: code:addons/golem_activity_registration/models/golem_activity_registration.py:39
#: sql_constraint:golem.activity:0 #: sql_constraint:golem.activity:0
#, python-format #, python-format
msgid "Number of places cannot be negative." msgid "Number of places cannot be negative."
@ -246,7 +240,7 @@ msgid "Season"
msgstr "Saison" msgstr "Saison"
#. module: golem_activity_registration #. module: golem_activity_registration
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:69 #: code:addons/golem_activity_registration/models/golem_activity_registration.py:70
#, python-format #, python-format
msgid "Sorry, there is no more place !" msgid "Sorry, there is no more place !"
msgstr "Désolé, il n'y a plus de place disponible !" msgstr "Désolé, il n'y a plus de place disponible !"
@ -257,13 +251,13 @@ msgid "Subscription"
msgstr "Inscription" msgstr "Inscription"
#. module: golem_activity_registration #. module: golem_activity_registration
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:99 #: code:addons/golem_activity_registration/models/golem_activity_registration.py:100
#, python-format #, python-format
msgid "Subscription can not be executed : the targeted member is not on the same season as the activity." 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é." 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 #. module: golem_activity_registration
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:91 #: code:addons/golem_activity_registration/models/golem_activity_registration.py:92
#: sql_constraint:golem.activity.registration:0 #: sql_constraint:golem.activity.registration:0
#, python-format #, python-format
msgid "This member has already been registered for this activity." msgid "This member has already been registered for this activity."

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-12 14:17+0000\n" "POT-Creation-Date: 2018-07-20 07:46+0000\n"
"PO-Revision-Date: 2018-06-12 14:17+0000\n" "PO-Revision-Date: 2018-07-20 07:46+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -37,7 +37,7 @@ msgstr ""
#. module: golem_activity_registration #. module: golem_activity_registration
#: model:ir.ui.view,arch_db:golem_activity_registration.golem_activity_report_template_inherited_golem_activity_registration #: model:ir.ui.view,arch_db:golem_activity_registration.golem_activity_report_template_inherited_golem_activity_registration
msgid "<i class=\"fa fa-user\"/>Name" msgid "<i class=\"fa fa-user\"/> Name"
msgstr "" msgstr ""
#. module: golem_activity_registration #. module: golem_activity_registration
@ -46,6 +46,11 @@ msgstr ""
msgid "Activities" msgid "Activities"
msgstr "" msgstr ""
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_member_activity_registration_ids
msgid "Activities for default season"
msgstr ""
#. module: golem_activity_registration #. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_registration_activity_id #: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_registration_activity_id
msgid "Activity" msgid "Activity"
@ -91,16 +96,6 @@ msgstr ""
msgid "Created on" msgid "Created on"
msgstr "" msgstr ""
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_member_activity_registration_ids
msgid "Current activities"
msgstr ""
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_registration_is_current
msgid "Current season?"
msgstr ""
#. module: golem_activity_registration #. module: golem_activity_registration
#: model:ir.ui.view,arch_db:golem_activity_registration.golem_member_card_template_inherit_golem_activity_resgitration #: model:ir.ui.view,arch_db:golem_activity_registration.golem_member_card_template_inherit_golem_activity_resgitration
msgid "Date start" msgid "Date start"
@ -117,8 +112,8 @@ msgid "Day"
msgstr "" msgstr ""
#. module: golem_activity_registration #. module: golem_activity_registration
#: model:ir.ui.view,arch_db:golem_activity_registration.golem_activity_registration_search #: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_registration_is_default
msgid "Default season" msgid "Default season?"
msgstr "" msgstr ""
#. module: golem_activity_registration #. module: golem_activity_registration
@ -208,7 +203,7 @@ msgid "Name"
msgstr "" msgstr ""
#. module: golem_activity_registration #. module: golem_activity_registration
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:38 #: code:addons/golem_activity_registration/models/golem_activity_registration.py:39
#: sql_constraint:golem.activity:0 #: sql_constraint:golem.activity:0
#, python-format #, python-format
msgid "Number of places cannot be negative." msgid "Number of places cannot be negative."
@ -245,7 +240,7 @@ msgid "Season"
msgstr "" msgstr ""
#. module: golem_activity_registration #. module: golem_activity_registration
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:69 #: code:addons/golem_activity_registration/models/golem_activity_registration.py:70
#, python-format #, python-format
msgid "Sorry, there is no more place !" msgid "Sorry, there is no more place !"
msgstr "" msgstr ""
@ -256,13 +251,13 @@ msgid "Subscription"
msgstr "" msgstr ""
#. module: golem_activity_registration #. module: golem_activity_registration
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:99 #: code:addons/golem_activity_registration/models/golem_activity_registration.py:100
#, python-format #, python-format
msgid "Subscription can not be executed : the targeted member is not on the same season as the activity." msgid "Subscription can not be executed : the targeted member is not on the same season as the activity."
msgstr "" msgstr ""
#. module: golem_activity_registration #. module: golem_activity_registration
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:91 #: code:addons/golem_activity_registration/models/golem_activity_registration.py:92
#: sql_constraint:golem.activity.registration:0 #: sql_constraint:golem.activity.registration:0
#, python-format #, python-format
msgid "This member has already been registered for this activity." msgid "This member has already been registered for this activity."

View File

@ -1,19 +1,19 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# copyright 2017 fabien bourgeois <fabien@yaltik.com>
# #
# this program is free software: you can redistribute it and/or modify # Copyright 2017-2018 Fabien Bourgeois <fabien@yaltik.com>
# 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, # This program is free software: you can redistribute it and/or modify
# but without any warranty; without even the implied warranty of # it under the terms of the GNU Affero General Public License as
# merchantability or fitness for a particular purpose. see the # published by the Free Software Foundation, either version 3 of the
# gnu affero general public license for more details. # License, or (at your option) any later version.
# #
# you should have received a copy of the gnu affero general public license # This program is distributed in the hope that it will be useful,
# along with this program. if not, see <http://www.gnu.org/licenses/>. # 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 Registration """ """ GOLEM Activity Registration """
@ -24,8 +24,9 @@ class GolemMember(models.Model):
_inherit = 'golem.member' _inherit = 'golem.member'
activity_registration_ids = fields.One2many('golem.activity.registration', activity_registration_ids = fields.One2many('golem.activity.registration',
'member_id', 'Current activities', 'member_id',
domain=[('is_current', '=', True)]) 'Activities for default season',
domain=[('is_default', '=', True)])
activity_registration_all_ids = fields.One2many('golem.activity.registration', activity_registration_all_ids = fields.One2many('golem.activity.registration',
'member_id', 'All activities') 'member_id', 'All activities')
@ -83,8 +84,8 @@ class GolemActivityRegistration(models.Model):
activity_price = fields.Float(related='activity_id.list_price') activity_price = fields.Float(related='activity_id.list_price')
season_id = fields.Many2one(string='Season', season_id = fields.Many2one(string='Season',
related='activity_id.season_id', store=True) related='activity_id.season_id', store=True)
is_current = fields.Boolean('Current season?', is_default = fields.Boolean('Default season?',
related='activity_id.is_current', store=True) related='activity_id.is_default')
_sql_constraints = [ _sql_constraints = [
('registration_uniq', 'UNIQUE (member_id, activity_id)', ('registration_uniq', 'UNIQUE (member_id, activity_id)',

View File

@ -44,8 +44,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree create="true" edit="false" delete="false" editable="top"> <tree create="true" edit="false" delete="false" editable="top">
<field name="season_id" readonly="1" /> <field name="season_id" readonly="1" />
<field name="member_id" domain="[('is_current', '=', True)]" /> <field name="member_id" domain="[('is_default', '=', True)]" />
<field name="activity_id" domain="[('is_current', '=', True)]" /> <field name="activity_id" domain="[('is_default', '=', True)]" />
</tree> </tree>
</field> </field>
</record> </record>
@ -60,7 +60,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="member_id" widget="many2one" /> <field name="member_id" widget="many2one" />
<field name="activity_id" widget="many2one" /> <field name="activity_id" widget="many2one" />
<filter name="season_default" string="Default season" <filter name="season_default" string="Default season"
domain="[('is_current', '=', True)]" /> domain="[('is_default', '=', True)]" />
<filter name="group_season" string="By season" <filter name="group_season" string="By season"
context="{'group_by': 'season_id'}"/> context="{'group_by': 'season_id'}"/>
</search> </search>
@ -72,7 +72,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="name">GOLEM Activity Registration List</field> <field name="name">GOLEM Activity Registration List</field>
<field name="res_model">golem.activity.registration</field> <field name="res_model">golem.activity.registration</field>
<field name="view_mode">tree</field> <field name="view_mode">tree</field>
<field name="context">{'search_default_season_default': True}</field>
</record> </record>
<!-- Menu --> <!-- Menu -->

View File

@ -34,7 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
context="{'default_member_id': active_id}"> context="{'default_member_id': active_id}">
<tree editable="top"> <tree editable="top">
<field name="activity_id" <field name="activity_id"
domain="[('is_current', '=', True)]" /> domain="[('is_default', '=', True)]" />
<field name="season_id" readonly="1" /> <field name="season_id" readonly="1" />
<field name="member_id" readonly="1" invisible="1" /> <field name="member_id" readonly="1" invisible="1" />
<field name="activity_price" string="Base price" sum="Total" /> <field name="activity_price" string="Base price" sum="Total" />

View File

@ -20,7 +20,7 @@
'name': 'GOLEM non-profit members', 'name': 'GOLEM non-profit members',
'summary': 'Extends Odoo contacts for MJC', 'summary': 'Extends Odoo contacts for MJC',
'description': 'Extends Odoo contacts for MJC', 'description': 'Extends Odoo contacts for MJC',
'version': '10.0.1.2.2', 'version': '10.0.1.3.0',
'category': 'GOLEM', 'category': 'GOLEM',
'author': 'Fabien Bourgeois, Michel Dessenne', 'author': 'Fabien Bourgeois, Michel Dessenne',
'license': 'AGPL-3', 'license': 'AGPL-3',

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-17 06:55+0000\n" "POT-Creation-Date: 2018-07-20 07:46+0000\n"
"PO-Revision-Date: 2018-07-17 09:01+0200\n" "PO-Revision-Date: 2018-07-20 10:03+0200\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -283,11 +283,6 @@ msgstr "Devise"
msgid "Current Membership Status" msgid "Current Membership Status"
msgstr "État actuel de l'adhésion" msgstr "État actuel de l'adhésion"
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_is_current
msgid "Current user?"
msgstr "Adhérent de cette saison?"
#. module: golem_member #. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_property_payment_term_id #: model:ir.model.fields,field_description:golem_member.field_golem_member_property_payment_term_id
msgid "Customer Payment Terms" msgid "Customer Payment Terms"
@ -318,6 +313,11 @@ msgstr "Date jusqu'à laquelle l'adhésion reste active."
msgid "Default season" msgid "Default season"
msgstr "Saison par défaut" msgstr "Saison par défaut"
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_is_default
msgid "Default season?"
msgstr "Usager de la saison par défaut?"
#. module: golem_member #. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_trust #: model:ir.model.fields,field_description:golem_member.field_golem_member_trust
msgid "Degree of trust you have in this debtor" msgid "Degree of trust you have in this debtor"
@ -338,7 +338,7 @@ msgstr "Nom affiché"
#. module: golem_member #. module: golem_member
#: model:ir.model.fields,help:golem_member.field_golem_member_partner_share #: model:ir.model.fields,help:golem_member.field_golem_member_partner_share
msgid "Either customer (no user), either shared user. Indicated the current partner is a customer without access or with a limited access created for sharing data." msgid "Either customer (no user), either shared user. Indicated the current partner is a customer without access or with a limited access created for sharing data."
msgstr "Soit un contact (pas un utilisateur), soit un utilisateur partagé. Indique que le contact actuel est un client sans permission ou avec des accès limités créés pour partager des données." msgstr "Either customer (no user), either shared user. Indicated the current partner is a customer without access or with a limited access created for sharing data."
#. module: golem_member #. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_electronic_processing_agreement #: model:ir.model.fields,field_description:golem_member.field_golem_member_electronic_processing_agreement
@ -366,7 +366,7 @@ msgid "Fax"
msgstr "Fax" msgstr "Fax"
#. module: golem_member #. module: golem_member
#: code:addons/golem_member/models/golem_member.py:39 #: code:addons/golem_member/models/golem_member.py:40
#, python-format #, python-format
msgid "Female" msgid "Female"
msgstr "Féminin" msgstr "Féminin"
@ -438,11 +438,16 @@ msgid "GOLEM Members Tags"
msgstr "Catégories d'adhérents" msgstr "Catégories d'adhérents"
#. module: golem_member #. module: golem_member
#: code:addons/golem_member/models/golem_member.py:318 #: code:addons/golem_member/models/golem_member.py:334
#, python-format #, python-format
msgid "GOLEM Members merge has not been implemented yet. Please only merge partners, not members, or delete GOLEM Members manually before merging." 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." 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_season
msgid "GOLEM Season"
msgstr "Saison"
#. module: golem_member #. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_gender #: model:ir.model.fields,field_description:golem_member.field_golem_member_gender
msgid "Gender" msgid "Gender"
@ -618,7 +623,7 @@ msgid "Latest Invoices & Payments Matching Date"
msgstr "Date de dernière correspondance des factures et paiements" msgstr "Date de dernière correspondance des factures et paiements"
#. module: golem_member #. module: golem_member
#: code:addons/golem_member/models/golem_member.py:39 #: code:addons/golem_member/models/golem_member.py:40
#, python-format #, python-format
msgid "Male" msgid "Male"
msgstr "Masculin" msgstr "Masculin"
@ -674,7 +679,7 @@ msgstr "Numéro d'adhérent"
#. module: golem_member #. module: golem_member
#: model:ir.ui.menu,name:golem_member.golem_members_menu #: model:ir.ui.menu,name:golem_member.golem_members_menu
msgid "Members" msgid "Members"
msgstr "Adhérents" msgstr "Membres"
#. module: golem_member #. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_member_lines #: model:ir.model.fields,field_description:golem_member.field_golem_member_member_lines
@ -725,8 +730,8 @@ msgid "Nationality"
msgstr "Nationalité" msgstr "Nationalité"
#. module: golem_member #. module: golem_member
#: code:addons/golem_member/models/golem_member.py:261 #: code:addons/golem_member/models/golem_member.py:277
#: code:addons/golem_member/models/golem_member.py:264 #: code:addons/golem_member/models/golem_member.py:280
#: selection:golem.member.numberconfig,is_automatic:0 #: selection:golem.member.numberconfig,is_automatic:0
#: selection:golem.member.numberconfig,is_per_season:0 #: selection:golem.member.numberconfig,is_per_season:0
#, python-format #, python-format
@ -961,7 +966,7 @@ msgstr "Numéro fiscal"
#. module: golem_member #. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_category_id #: model:ir.model.fields,field_description:golem_member.field_golem_member_category_id
msgid "Tags" msgid "Tags"
msgstr "Étiquettes" msgstr "Catégories"
#. module: golem_member #. module: golem_member
#: model:ir.ui.view,arch_db:golem_member.golem_member_form #: model:ir.ui.view,arch_db:golem_member.golem_member_form
@ -1039,7 +1044,7 @@ 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." msgstr "Ce champ contient l'image utilisée comme photo d'identité pour ce contact, limitée à 1024x1024px."
#. module: golem_member #. module: golem_member
#: code:addons/golem_member/models/golem_member.py:77 #: code:addons/golem_member/models/golem_member.py:78
#: sql_constraint:golem.member:0 #: sql_constraint:golem.member:0
#, python-format #, python-format
msgid "This member number has already been used." msgid "This member number has already been used."
@ -1105,6 +1110,12 @@ msgstr "Montant total que ce client vous doit."
msgid "Total amount you have to pay to this vendor." msgid "Total amount you have to pay to this vendor."
msgstr "Montant total à payer au fournisseur." msgstr "Montant total à payer au fournisseur."
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:145
#, python-format
msgid "Unsupported operator for defautl season search"
msgstr "Opérateur de recherche non supporté pour le filtre de saison par défaut"
#. module: golem_member #. module: golem_member
#: model:ir.model.fields,help:golem_member.field_golem_member_type #: model:ir.model.fields,help:golem_member.field_golem_member_type
msgid "Used to select automatically the right address according to the context in sales and purchases documents." msgid "Used to select automatically the right address according to the context in sales and purchases documents."
@ -1136,8 +1147,8 @@ msgid "Website of Partner or Company"
msgstr "Site Web pour les Partenaires ou les Sociétés" msgstr "Site Web pour les Partenaires ou les Sociétés"
#. module: golem_member #. module: golem_member
#: code:addons/golem_member/models/golem_member.py:261 #: code:addons/golem_member/models/golem_member.py:277
#: code:addons/golem_member/models/golem_member.py:264 #: code:addons/golem_member/models/golem_member.py:280
#: selection:golem.member.numberconfig,is_automatic:0 #: selection:golem.member.numberconfig,is_automatic:0
#: selection:golem.member.numberconfig,is_per_season:0 #: selection:golem.member.numberconfig,is_per_season:0
#, python-format #, python-format

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-17 06:55+0000\n" "POT-Creation-Date: 2018-07-20 07:46+0000\n"
"PO-Revision-Date: 2018-07-17 06:55+0000\n" "PO-Revision-Date: 2018-07-20 07:46+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -283,11 +283,6 @@ msgstr ""
msgid "Current Membership Status" msgid "Current Membership Status"
msgstr "" msgstr ""
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_is_current
msgid "Current user?"
msgstr ""
#. module: golem_member #. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_property_payment_term_id #: model:ir.model.fields,field_description:golem_member.field_golem_member_property_payment_term_id
msgid "Customer Payment Terms" msgid "Customer Payment Terms"
@ -318,6 +313,11 @@ msgstr ""
msgid "Default season" msgid "Default season"
msgstr "" msgstr ""
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_is_default
msgid "Default season?"
msgstr ""
#. module: golem_member #. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_trust #: model:ir.model.fields,field_description:golem_member.field_golem_member_trust
msgid "Degree of trust you have in this debtor" msgid "Degree of trust you have in this debtor"
@ -366,7 +366,7 @@ msgid "Fax"
msgstr "" msgstr ""
#. module: golem_member #. module: golem_member
#: code:addons/golem_member/models/golem_member.py:39 #: code:addons/golem_member/models/golem_member.py:40
#, python-format #, python-format
msgid "Female" msgid "Female"
msgstr "" msgstr ""
@ -438,11 +438,16 @@ msgid "GOLEM Members Tags"
msgstr "" msgstr ""
#. module: golem_member #. module: golem_member
#: code:addons/golem_member/models/golem_member.py:318 #: code:addons/golem_member/models/golem_member.py:334
#, python-format #, python-format
msgid "GOLEM Members merge has not been implemented yet. Please only merge partners, not members, or delete GOLEM Members manually before merging." msgid "GOLEM Members merge has not been implemented yet. Please only merge partners, not members, or delete GOLEM Members manually before merging."
msgstr "" msgstr ""
#. module: golem_member
#: model:ir.model,name:golem_member.model_golem_season
msgid "GOLEM Season"
msgstr ""
#. module: golem_member #. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_gender #: model:ir.model.fields,field_description:golem_member.field_golem_member_gender
msgid "Gender" msgid "Gender"
@ -612,7 +617,7 @@ msgid "Latest Invoices & Payments Matching Date"
msgstr "" msgstr ""
#. module: golem_member #. module: golem_member
#: code:addons/golem_member/models/golem_member.py:39 #: code:addons/golem_member/models/golem_member.py:40
#, python-format #, python-format
msgid "Male" msgid "Male"
msgstr "" msgstr ""
@ -719,8 +724,8 @@ msgid "Nationality"
msgstr "" msgstr ""
#. module: golem_member #. module: golem_member
#: code:addons/golem_member/models/golem_member.py:261 #: code:addons/golem_member/models/golem_member.py:277
#: code:addons/golem_member/models/golem_member.py:264 #: code:addons/golem_member/models/golem_member.py:280
#: selection:golem.member.numberconfig,is_automatic:0 #: selection:golem.member.numberconfig,is_automatic:0
#: selection:golem.member.numberconfig,is_per_season:0 #: selection:golem.member.numberconfig,is_per_season:0
#, python-format #, python-format
@ -1031,7 +1036,7 @@ msgid "This field holds the image used as avatar for this contact, limited to 10
msgstr "" msgstr ""
#. module: golem_member #. module: golem_member
#: code:addons/golem_member/models/golem_member.py:77 #: code:addons/golem_member/models/golem_member.py:78
#: sql_constraint:golem.member:0 #: sql_constraint:golem.member:0
#, python-format #, python-format
msgid "This member number has already been used." msgid "This member number has already been used."
@ -1097,6 +1102,12 @@ msgstr ""
msgid "Total amount you have to pay to this vendor." msgid "Total amount you have to pay to this vendor."
msgstr "" msgstr ""
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:145
#, python-format
msgid "Unsupported operator for defautl season search"
msgstr ""
#. module: golem_member #. module: golem_member
#: model:ir.model.fields,help:golem_member.field_golem_member_type #: model:ir.model.fields,help:golem_member.field_golem_member_type
msgid "Used to select automatically the right address according to the context in sales and purchases documents." msgid "Used to select automatically the right address according to the context in sales and purchases documents."
@ -1128,8 +1139,8 @@ msgid "Website of Partner or Company"
msgstr "" msgstr ""
#. module: golem_member #. module: golem_member
#: code:addons/golem_member/models/golem_member.py:261 #: code:addons/golem_member/models/golem_member.py:277
#: code:addons/golem_member/models/golem_member.py:264 #: code:addons/golem_member/models/golem_member.py:280
#: selection:golem.member.numberconfig,is_automatic:0 #: selection:golem.member.numberconfig,is_automatic:0
#: selection:golem.member.numberconfig,is_per_season:0 #: selection:golem.member.numberconfig,is_per_season:0
#, python-format #, python-format

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright 2016 Fabien Bourgeois <fabien@yaltik.com> # Copyright 2016-2018 Fabien Bourgeois <fabien@yaltik.com>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -15,4 +15,4 @@
# You should have received a copy of the GNU Affero General Public License # 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/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from . import golem_member from . import golem_member, golem_season

View File

@ -32,6 +32,7 @@ class ResPartner(models.Model):
return self.env.ref('base.main_company').country_id return self.env.ref('base.main_company').country_id
nationality_id = fields.Many2one('res.country', 'Nationality', nationality_id = fields.Many2one('res.country', 'Nationality',
auto_join=True,
default=_get_default_nationality_id) default=_get_default_nationality_id)
country_id = fields.Many2one(default=_get_default_nationality_id) country_id = fields.Many2one(default=_get_default_nationality_id)
@ -80,7 +81,7 @@ class GolemMember(models.Model):
ondelete='cascade') ondelete='cascade')
@api.model @api.model
def _default_season(self): def default_season(self):
""" Get default season """ """ Get default season """
domain = [('is_default', '=', True)] domain = [('is_default', '=', True)]
return self.env['golem.season'].search(domain, limit=1) return self.env['golem.season'].search(domain, limit=1)
@ -97,10 +98,11 @@ class GolemMember(models.Model):
help='If this field has been checked, it ' help='If this field has been checked, it '
'tells that the user refuses to receive SMS') 'tells that the user refuses to receive SMS')
season_ids = fields.Many2many('golem.season', string='Seasons', season_ids = fields.Many2many('golem.season', string='Seasons',
required=True, default=_default_season, required=True, default=default_season,
ondelete='restrict') auto_join=True, ondelete='restrict')
is_current = fields.Boolean('Current user?', default=False, readonly=True, is_default = fields.Boolean('Default season?',
store=True, compute='_compute_is_current') compute='_compute_is_default',
search='_search_is_default')
is_number_manual = fields.Boolean('Is number manual?', store=False, is_number_manual = fields.Boolean('Is number manual?', store=False,
compute='_compute_is_number_manual') compute='_compute_is_number_manual')
@ -126,11 +128,23 @@ class GolemMember(models.Model):
member.number_name = u' - '.join(vals) member.number_name = u' - '.join(vals)
@api.depends('season_ids') @api.depends('season_ids')
def _compute_is_current(self): def _compute_is_default(self):
""" Computes is current according to seasons """ """ Computes is current according to seasons """
default_s = self._default_season() default_s = self._default_season()
for member in self: for member in self:
member.is_current = default_s in member.season_ids member.is_default = default_s in member.season_ids
@api.multi
def _search_is_default(self, operator, value):
""" Search function for is default """
if operator in ('in', '='):
operator = '=' if value else '!='
elif operator in ('not in', '!='):
operator = '!=' if value else '='
else:
err = _('Unsupported operator for defautl season search')
raise NotImplementedError(err)
return [('season_ids', operator, self.default_season().id)]
@api.depends('number') @api.depends('number')
def _compute_is_number_manual(self): def _compute_is_number_manual(self):

View File

@ -0,0 +1,37 @@
# -*- 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/>.
""" GOLEM Season adaptations """
from odoo import models, api
class GolemSeason(models.Model):
""" GOLEM Season adaptations """
_inherit = 'golem.season'
@api.multi
def do_default_season(self):
""" Add number regenration in some cases """
self.ensure_one()
res = super(GolemSeason, self).do_default_season()
all_members = self.env['golem.member'].search([])
conf = self.env['ir.config_parameter']
if conf.get_param('golem_numberconfig_isautomatic') == '1' and \
conf.get_param('golem_numberconfig_isperseason') == '1':
all_members.generate_number()
return res

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright 2017 Fabien Bourgeois <fabien@yaltik.com> # Copyright 2017-2018 Fabien Bourgeois <fabien@yaltik.com>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -46,16 +46,16 @@ class GolemMemberTestCase(TransactionCase):
self.assertIn('Error(s) with partner', exc_cm.exception.args[0]) self.assertIn('Error(s) with partner', exc_cm.exception.args[0])
self.assertEqual('No name is set.', exc_cm.exception.args[1]) self.assertEqual('No name is set.', exc_cm.exception.args[1])
def test_current_season(self): def test_default_season(self):
""" Test if default season if fixed according to setUp and if users """ Test if default season if fixed according to setUp and if users
are correctly seen """ are correctly seen """
self.assertEqual(self.member_model._default_season(), self.assertEqual(self.member_model._default_season(),
self.season_current) self.season_current)
self.assertTrue(self.member1.is_current) self.assertTrue(self.member1.is_default)
self.assertTrue(self.member2.is_current) self.assertTrue(self.member2.is_default)
self.season_next.do_default_season() self.season_next.do_default_season()
self.assertFalse(self.member1.is_current) self.assertFalse(self.member1.is_default)
self.assertFalse(self.member2.is_current) self.assertFalse(self.member2.is_default)
def test_member_numbers_manual(self): def test_member_numbers_manual(self):
""" Tests manual member number generation """ """ Tests manual member number generation """
@ -82,9 +82,9 @@ class GolemMemberTestCase(TransactionCase):
self.member2.season_ids += self.season_next self.member2.season_ids += self.season_next
self.assertEqual(self.member2.number, u'M2') self.assertEqual(self.member2.number, u'M2')
self.season_next.do_default_season() self.season_next.do_default_season()
self.assertTrue(self.member2.is_current) self.assertTrue(self.member2.is_default)
self.assertEqual(self.member2.number, u'M1') self.assertEqual(self.member2.number, u'M1')
self.assertFalse(self.member1.is_current) self.assertFalse(self.member1.is_default)
self.assertFalse(self.member1.number) self.assertFalse(self.member1.number)
def test_mnumbers_auto_season_from(self): def test_mnumbers_auto_season_from(self):
@ -100,9 +100,9 @@ class GolemMemberTestCase(TransactionCase):
self.member2.season_ids += self.season_next self.member2.season_ids += self.season_next
self.assertEqual(self.member2.number, u'101') self.assertEqual(self.member2.number, u'101')
self.season_next.do_default_season() self.season_next.do_default_season()
self.assertTrue(self.member2.is_current) self.assertTrue(self.member2.is_default)
self.assertEqual(self.member2.number, u'100') self.assertEqual(self.member2.number, u'100')
self.assertFalse(self.member1.is_current) self.assertFalse(self.member1.is_default)
self.assertFalse(self.member1.number) self.assertFalse(self.member1.number)
def test_member_numbers_auto_global(self): def test_member_numbers_auto_global(self):

View File

@ -218,7 +218,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="email" /> <field name="email" />
<field name="category_id" widget="many2one" /> <field name="category_id" widget="many2one" />
<filter name="season_default" string="Default season" <filter name="season_default" string="Default season"
domain="[('is_current', '=', True)]" /> domain="[('is_default', '=', True)]" />
<group string="Group By"> <group string="Group By">
<filter name="group_age" string="By age" <filter name="group_age" string="By age"
context="{'group_by': 'is_minor'}"/> context="{'group_by': 'is_minor'}"/>
@ -246,8 +246,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<act_window id="golem_member_action" <act_window id="golem_member_action"
name="GOLEM Members" name="GOLEM Members"
res_model="golem.member" res_model="golem.member"
view_mode="kanban,tree,form,graph" view_mode="kanban,tree,form,graph" />
context="{'search_default_season_default': True}" />
<act_window id="res_partner_category_action" name="GOLEM Members Tags" <act_window id="res_partner_category_action" name="GOLEM Members Tags"
res_model="res.partner.category" view_mode="tree,form" /> res_model="res.partner.category" view_mode="tree,form" />

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-17 15:27+0000\n" "POT-Creation-Date: 2018-07-20 07:47+0000\n"
"PO-Revision-Date: 2018-07-17 17:47+0200\n" "PO-Revision-Date: 2018-07-20 09:51+0200\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -26,7 +26,7 @@ msgid "Cancel"
msgstr "Annuler" msgstr "Annuler"
#. module: golem_membership #. module: golem_membership
#: code:addons/golem_membership/models/account_config.py:43 #: code:addons/golem_membership/models/account_config.py:45
#, python-format #, python-format
msgid "Check" msgid "Check"
msgstr "Chèque" msgstr "Chèque"
@ -42,7 +42,7 @@ msgid "Created on"
msgstr "Créé le" msgstr "Créé le"
#. module: golem_membership #. module: golem_membership
#: code:addons/golem_membership/models/account_config.py:48 #: code:addons/golem_membership/models/account_config.py:52
#, python-format #, python-format
msgid "Credit Card" msgid "Credit Card"
msgstr "Carte bancaire" msgstr "Carte bancaire"

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-17 15:27+0000\n" "POT-Creation-Date: 2018-07-20 07:47+0000\n"
"PO-Revision-Date: 2018-07-17 15:27+0000\n" "PO-Revision-Date: 2018-07-20 07:47+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -26,7 +26,7 @@ msgid "Cancel"
msgstr "" msgstr ""
#. module: golem_membership #. module: golem_membership
#: code:addons/golem_membership/models/account_config.py:43 #: code:addons/golem_membership/models/account_config.py:45
#, python-format #, python-format
msgid "Check" msgid "Check"
msgstr "" msgstr ""
@ -42,7 +42,7 @@ msgid "Created on"
msgstr "" msgstr ""
#. module: golem_membership #. module: golem_membership
#: code:addons/golem_membership/models/account_config.py:48 #: code:addons/golem_membership/models/account_config.py:52
#, python-format #, python-format
msgid "Credit Card" msgid "Credit Card"
msgstr "" msgstr ""

View File

@ -22,7 +22,7 @@
- add season with name and period ; - add season with name and period ;
- choose on per default season ; - choose on per default season ;
- link optionnally one or many memberships types''', - link optionnally one or many memberships types''',
'version': '10.0.1.1.1', 'version': '10.0.1.2.0',
'category': 'GOLEM', 'category': 'GOLEM',
'author': 'Fabien Bourgeois', 'author': 'Fabien Bourgeois',
'license': 'AGPL-3', 'license': 'AGPL-3',

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-06 07:14+0000\n" "POT-Creation-Date: 2018-07-20 07:46+0000\n"
"PO-Revision-Date: 2018-03-06 07:14+0000\n" "PO-Revision-Date: 2018-07-20 09:50+0200\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -31,7 +31,7 @@ msgid "Created on"
msgstr "Créé le" msgstr "Créé le"
#. module: golem_season #. module: golem_season
#: code:addons/golem_season/models/golem_season.py:73 #: code:addons/golem_season/models/golem_season.py:75
#, python-format #, python-format
msgid "Current period cannot be included into another existing period." msgid "Current period cannot be included into another existing period."
msgstr "La période actuelle est en conflit avec une période existante." msgstr "La période actuelle est en conflit avec une période existante."
@ -57,7 +57,7 @@ msgid "Display Name"
msgstr "Nom affiché" msgstr "Nom affiché"
#. module: golem_season #. module: golem_season
#: code:addons/golem_season/models/golem_season.py:69 #: code:addons/golem_season/models/golem_season.py:71
#, python-format #, python-format
msgid "End of the period is in range of an existing period." msgid "End of the period is in range of an existing period."
msgstr "La fin de la période est en conflit avec une période existante." msgstr "La fin de la période est en conflit avec une période existante."
@ -141,38 +141,39 @@ msgid "Seasons"
msgstr "Saisons" msgstr "Saisons"
#. module: golem_season #. module: golem_season
#: code:addons/golem_season/models/golem_season.py:60 #: code:addons/golem_season/models/golem_season.py:62
#, python-format #, python-format
msgid "Start of the period cannot be after end of the period." msgid "Start of the period cannot be after end of the period."
msgstr "Le début de la période ne peut être postérieur à sa fin." msgstr "Le début de la période ne peut être postérieur à sa fin."
#. module: golem_season #. module: golem_season
#: code:addons/golem_season/models/golem_season.py:65 #: code:addons/golem_season/models/golem_season.py:67
#, python-format #, python-format
msgid "Start of the period is in range of an existing period." msgid "Start of the period is in range of an existing period."
msgstr "Le début de la période est en conflit avec une période existante." msgstr "Le début de la période est en conflit avec une période existante."
#. module: golem_season #. module: golem_season
#: code:addons/golem_season/models/golem_season.py:56 #: code:addons/golem_season/models/golem_season.py:58
#, python-format #, python-format
msgid "The date end is required" msgid "The date end is required"
msgstr "The date end is required" msgstr "The date end is required"
#. module: golem_season #. module: golem_season
#: code:addons/golem_season/models/golem_season.py:58 #: code:addons/golem_season/models/golem_season.py:60
#, python-format #, python-format
msgid "The date start is required" msgid "The date start is required"
msgstr "The date start is required" msgstr "The date start is required"
#. module: golem_season #. module: golem_season
#: code:addons/golem_season/models/golem_season.py:28 #: code:addons/golem_season/models/golem_season.py:29
#: sql_constraint:golem.season:0 #: sql_constraint:golem.season:0
#, python-format #, python-format
msgid "This season name has already been used." msgid "This season name has already been used."
msgstr "Ce nom pour la saison a déjà été utilisé. Merci d'en choisir un autre." msgstr "Ce nom pour la saison a déjà été utilisé. Merci d'en choisir un autre."
#. module: golem_season #. module: golem_season
#: code:addons/golem_season/models/golem_season.py:112 #: code:addons/golem_season/models/golem_season.py:100
#, python-format #, python-format
msgid "You can't delete the default season" msgid "You can't delete the default season"
msgstr "Vous ne pouvez pas supprimer la saison par défaut" msgstr "Vous ne pouvez pas supprimer la saison par défaut"

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-06 07:14+0000\n" "POT-Creation-Date: 2018-07-20 07:46+0000\n"
"PO-Revision-Date: 2018-03-06 07:14+0000\n" "PO-Revision-Date: 2018-07-20 07:46+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -31,7 +31,7 @@ msgid "Created on"
msgstr "" msgstr ""
#. module: golem_season #. module: golem_season
#: code:addons/golem_season/models/golem_season.py:73 #: code:addons/golem_season/models/golem_season.py:75
#, python-format #, python-format
msgid "Current period cannot be included into another existing period." msgid "Current period cannot be included into another existing period."
msgstr "" msgstr ""
@ -57,7 +57,7 @@ msgid "Display Name"
msgstr "" msgstr ""
#. module: golem_season #. module: golem_season
#: code:addons/golem_season/models/golem_season.py:69 #: code:addons/golem_season/models/golem_season.py:71
#, python-format #, python-format
msgid "End of the period is in range of an existing period." msgid "End of the period is in range of an existing period."
msgstr "" msgstr ""
@ -141,38 +141,38 @@ msgid "Seasons"
msgstr "" msgstr ""
#. module: golem_season #. module: golem_season
#: code:addons/golem_season/models/golem_season.py:60 #: code:addons/golem_season/models/golem_season.py:62
#, python-format #, python-format
msgid "Start of the period cannot be after end of the period." msgid "Start of the period cannot be after end of the period."
msgstr "" msgstr ""
#. module: golem_season #. module: golem_season
#: code:addons/golem_season/models/golem_season.py:65 #: code:addons/golem_season/models/golem_season.py:67
#, python-format #, python-format
msgid "Start of the period is in range of an existing period." msgid "Start of the period is in range of an existing period."
msgstr "" msgstr ""
#. module: golem_season #. module: golem_season
#: code:addons/golem_season/models/golem_season.py:56 #: code:addons/golem_season/models/golem_season.py:58
#, python-format #, python-format
msgid "The date end is required" msgid "The date end is required"
msgstr "" msgstr ""
#. module: golem_season #. module: golem_season
#: code:addons/golem_season/models/golem_season.py:58 #: code:addons/golem_season/models/golem_season.py:60
#, python-format #, python-format
msgid "The date start is required" msgid "The date start is required"
msgstr "" msgstr ""
#. module: golem_season #. module: golem_season
#: code:addons/golem_season/models/golem_season.py:28 #: code:addons/golem_season/models/golem_season.py:29
#: sql_constraint:golem.season:0 #: sql_constraint:golem.season:0
#, python-format #, python-format
msgid "This season name has already been used." msgid "This season name has already been used."
msgstr "" msgstr ""
#. module: golem_season #. module: golem_season
#: code:addons/golem_season/models/golem_season.py:112 #: code:addons/golem_season/models/golem_season.py:100
#, python-format #, python-format
msgid "You can't delete the default season" msgid "You can't delete the default season"
msgstr "" msgstr ""

View File

@ -78,23 +78,12 @@ class GolemSeason(models.Model):
@api.multi @api.multi
def do_default_season(self): def do_default_season(self):
""" is_default on and ensure that only one is_default is active. Also """ is_default on and ensure that only one is_default is active """
recomputes is_current for members and activities. For simplicity use a
magic trick around registry rather than double inheritance """
self.ensure_one() self.ensure_one()
old_default_season = self.search([('is_default', '=', True)]) old_default_season = self.search([('is_default', '=', True)])
if old_default_season: if old_default_season:
old_default_season.is_default = False old_default_season.is_default = False
self.is_default = True self.is_default = True
if 'golem.member' in self.env.registry:
all_members = self.env['golem.member'].search([])
all_members.compute_is_current()
conf = self.env['ir.config_parameter']
if conf.get_param('golem_numberconfig_isautomatic') == '1' and \
conf.get_param('golem_numberconfig_isperseason') == '1':
all_members.generate_number()
if 'golem.activity' in self.env.registry:
self.env['golem.activity'].search([]).compute_is_current()
@api.model @api.model
def create(self, values): def create(self, values):