Merge branch 'master' into michel_qweb_adherents

This commit is contained in:
Fabien BOURGEOIS 2018-03-08 09:09:35 +01:00
commit da04cd5329
53 changed files with 3908 additions and 53 deletions

View File

@ -18,7 +18,7 @@
{
'name': 'GOLEM activities',
'summary': 'Extends Odoo products for multi-activity',
'version': '10.0.2.1.0',
'version': '10.0.2.1.1',
'category': 'GOLEM',
'author': 'Fabien Bourgeois, Michel Dessenne',
'license': 'AGPL-3',

View File

@ -108,15 +108,16 @@ class GolemActivity(models.Model):
def _check_period(self):
""" Checks if end date if after start date """
for activity in self:
season = activity.season_id
if activity.date_start and activity.date_stop and \
activity.date_start > activity.date_stop:
raise models.ValidationError(_('Start of the period cannot be '
'after end of the period.'))
if activity.season_id.date_start > activity.date_start:
if season.date_start and season.date_start > activity.date_start:
msg = _(u'Activity start date can not be set before '
'linked season start.')
raise models.ValidationError(msg)
if activity.season_id.date_end < activity.date_stop:
if season.date_end and season.date_end < activity.date_stop:
msg = _(u'Activity end date can not be set after '
'linked season end.')
raise models.ValidationError(msg)

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, wizard

View File

@ -0,0 +1,37 @@
# -*- 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 activity queues',
'summary': 'GOLEM activity queues',
'description': ''' GOLEM activity queue management ''',
'version': '10.0.1.2.3',
'category': 'GOLEM',
'author': 'Youssef El Ouahby, Fabien Bourgeois',
'license': 'AGPL-3',
'application': True,
'installable': True,
'depends': ['golem_activity', 'golem_activity_registration'],
'data': [
'security/ir.model.access.csv',
'views/golem_activity_queue_views.xml',
'views/golem_activity_views.xml',
'views/golem_member_views.xml',
'wizard/golem_activity_automated_queue_activate_views.xml'
]
}

View File

@ -0,0 +1,291 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * golem_activity_queue
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-07 18:55+0000\n"
"PO-Revision-Date: 2018-03-07 18:55+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_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_activity_id
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_queue_view_search
msgid "Activity"
msgstr "Activité"
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_automated_queue_activate_wizard_activity_id
msgid "Activity id"
msgstr "Activité liée"
#. module: golem_activity_queue
#: model:ir.actions.act_window,name:golem_activity_queue.golem_activity_queue_action
#: model:ir.ui.menu,name:golem_activity_queue.golem_activity_queue_menu
msgid "Activity queue"
msgstr "Liste d'attente"
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Add Queue"
msgstr "Ajouter une liste d'attente"
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Add from queue"
msgstr "Ajouter depuis la liste d'attente"
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_automated_queue_actiave_wizard_view_form
msgid "Are you sure you want to Add queue to this activity ?<br/>\n"
" If yes please confirm if you want automated registration from queue to activity."
msgstr "Êtes-vous sûr de vouloir ajouter une liste d'attente à cette activité ?<br/>\n"
" Si oui, merci de confirmer si vous souhaitez une inscription automatique depuis la liste d'attente."
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Are you sure you want to remove queue from this activity ? This will delete all elements currently registred in"
msgstr "Êtes-vous sûr de vouloir supprimer la liste d'attente pour cette activité ? Cela supprimera tous les membres inscrits dessus."
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Are you sure you want to switch to automated registration from queue mode ?"
msgstr "Êtes-vous sûr de vouloir passer à une inscription automatique depuis la liste d'attente ?"
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Are you sure you want to switch to manual registration from queue mode ?"
msgstr "Êtes-vous sûr de vouloir passer à une inscription manuelle depuis la liste d'attente ?"
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_auto_registration_from_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_automated_queue_activate_wizard_auto_registration_from_queue
msgid "Auto registration from queue"
msgstr "Inscription automatique depuis la liste d'attente"
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_automated_queue_actiave_wizard_view_form
msgid "Cancel"
msgstr "Annuler"
#. module: golem_activity_queue
#: code:addons/golem_activity_queue/models/golem_activity.py:52
#, python-format
msgid "Choose the activity to register in"
msgstr "Choisissez l'activité sur laquelle inscrire"
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_automated_queue_actiave_wizard_view_form
msgid "Confirm"
msgstr "Confirmer"
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_automated_queue_activate_wizard_create_uid
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_create_uid
msgid "Created by"
msgstr "Créé par"
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_automated_queue_activate_wizard_create_date
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_create_date
msgid "Created on"
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
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_queue_view_search
msgid "Default season"
msgstr "Saison par défaut"
#. 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_queue_display_name
msgid "Display Name"
msgstr "Nom affiché"
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_queue_view_search
msgid "Full Activity"
msgstr "Activité complète"
#. module: golem_activity_queue
#: model:ir.model,name:golem_activity_queue.model_golem_activity
msgid "GOLEM Activity"
msgstr "Activité"
#. module: golem_activity_queue
#: model:ir.model,name:golem_activity_queue.model_golem_activity_queue
msgid "GOLEM Activity Queue"
msgstr "Liste d'attente"
#. module: golem_activity_queue
#: model:ir.model,name:golem_activity_queue.model_golem_member
msgid "GOLEM Member"
msgstr "Adhérent"
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_queue_view_search
msgid "Group By"
msgstr "Grouper par"
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_automated_queue_activate_wizard_id
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_id
msgid "ID"
msgstr "ID"
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_automated_queue_activate_wizard___last_update
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue___last_update
msgid "Last Modified on"
msgstr "Dernière Modification le"
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_automated_queue_activate_wizard_write_uid
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_write_uid
msgid "Last Updated by"
msgstr "Dernière mise à jour par"
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_automated_queue_activate_wizard_write_date
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_write_date
msgid "Last Updated on"
msgstr "Dernière mise à jour le"
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_member_id
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_queue_view_search
msgid "Member"
msgstr "Adhérent"
#. module: golem_activity_queue
#: code:addons/golem_activity_queue/models/golem_activity.py:108
#, python-format
msgid "No remaining place for the activity : {}, please discard changes and register in the queue."
msgstr "Plus de place disponible pour l'activité {}, veuillez annuler vos modifications et utiliser la liste d'attente."
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_queue_view_search
msgid "Not Full Activity"
msgstr "Activité disponible"
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_activity_queue_ids
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_member_activity_queue_ids
msgid "Pending registration"
msgstr "Inscriptions en attente"
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_activity_number
msgid "Pending registration number"
msgstr "Numéro de l'inscription en attente"
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Queue"
msgstr "File d'attente"
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_allowed
msgid "Queue allowed"
msgstr "Liste d'attente activée"
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_member_form_inherit_golem_activity_queue
msgid "Queue list"
msgstr "Listes d'attente"
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Register from Queue"
msgstr "Inscrire depuis la liste d'attente"
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_automated_queue_actiave_wizard_view_form
msgid "Rejection reason"
msgstr "Motif du rejet"
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_places_remain
msgid "Remaining places"
msgstr "Places restantes"
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Remove Queue"
msgstr "Supprimer la liste d'attente"
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_season_id
msgid "Season"
msgstr "Saison"
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_sequence
msgid "Sequence"
msgstr "Séquence"
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Switch to automated registration from queue"
msgstr "Passer à une inscription automatique depuis la liste d'attente"
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Switch to manual registration from queue"
msgstr "Passer à une inscription manuelle depuis la liste d'attente"
#. module: golem_activity_queue
#: code:addons/golem_activity_queue/models/golem_activity_queue.py:52
#, python-format
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é"
#. module: golem_activity_queue
#: code:addons/golem_activity_queue/models/golem_activity.py:118
#, python-format
msgid "There is a free place for the activity : {}, once you save it will be filled by the first member from queue"
msgstr "Il y a une place disponible sur l'activité {}, une fois sauvegardée un membre de la liste d'attente sera automatiquement inscrit"
#. module: golem_activity_queue
#: code:addons/golem_activity_queue/models/golem_activity.py:122
#, python-format
msgid "There is a free place for the activity : {}, you may fill it manually from the queue"
msgstr "Il y a une place disponible sur l'activité {}, vous pouvez inscrire un membre depuis la liste d'attente"
#. module: golem_activity_queue
#: code:addons/golem_activity_queue/models/golem_member.py:39
#, python-format
msgid "This activity : {} is already full, please discard changes and register in the queue."
msgstr "L'activité {} est complète, veuillez annuler vos modifications et enregistrer le membre dans la liste d'attente."
#. module: golem_activity_queue
#: code:addons/golem_activity_queue/models/golem_activity_queue.py:30
#: sql_constraint:golem.activity.queue:0
#, python-format
msgid "This member has already been registered for the queue."
msgstr "Le membre a déjà été inscrit sur la liste d'attente."
#. module: golem_activity_queue
#: code:addons/golem_activity_queue/models/golem_activity.py:112
#: code:addons/golem_activity_queue/models/golem_activity.py:127
#: code:addons/golem_activity_queue/models/golem_member.py:43
#, python-format
msgid "Warning"
msgstr "Attention"
#. module: golem_activity_queue
#: model:ir.model,name:golem_activity_queue.model_golem_activity_automated_queue_activate_wizard
msgid "golem.activity.automated.queue.activate.wizard"
msgstr "golem.activity.automated.queue.activate.wizard"

View File

@ -0,0 +1,291 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * golem_activity_queue
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-07 18:54+0000\n"
"PO-Revision-Date: 2018-03-07 18:54+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_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_activity_id
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_queue_view_search
msgid "Activity"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_automated_queue_activate_wizard_activity_id
msgid "Activity id"
msgstr ""
#. module: golem_activity_queue
#: model:ir.actions.act_window,name:golem_activity_queue.golem_activity_queue_action
#: model:ir.ui.menu,name:golem_activity_queue.golem_activity_queue_menu
msgid "Activity queue"
msgstr ""
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Add Queue"
msgstr ""
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Add from queue"
msgstr ""
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_automated_queue_actiave_wizard_view_form
msgid "Are you sure you want to Add queue to this activity ?<br/>\n"
" If yes please confirm if you want automated registration from queue to activity."
msgstr ""
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Are you sure you want to remove queue from this activity ? This will delete all elements currently registred in"
msgstr ""
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Are you sure you want to switch to automated registration from queue mode ?"
msgstr ""
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Are you sure you want to switch to manual registration from queue mode ?"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_auto_registration_from_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_automated_queue_activate_wizard_auto_registration_from_queue
msgid "Auto registration from queue"
msgstr ""
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_automated_queue_actiave_wizard_view_form
msgid "Cancel"
msgstr ""
#. module: golem_activity_queue
#: code:addons/golem_activity_queue/models/golem_activity.py:52
#, python-format
msgid "Choose the activity to register in"
msgstr ""
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_automated_queue_actiave_wizard_view_form
msgid "Confirm"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_automated_queue_activate_wizard_create_uid
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_create_uid
msgid "Created by"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_automated_queue_activate_wizard_create_date
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_create_date
msgid "Created on"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_is_current
msgid "Current season?"
msgstr ""
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_queue_view_search
msgid "Default season"
msgstr ""
#. 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_queue_display_name
msgid "Display Name"
msgstr ""
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_queue_view_search
msgid "Full Activity"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model,name:golem_activity_queue.model_golem_activity
msgid "GOLEM Activity"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model,name:golem_activity_queue.model_golem_activity_queue
msgid "GOLEM Activity Queue"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model,name:golem_activity_queue.model_golem_member
msgid "GOLEM Member"
msgstr ""
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_queue_view_search
msgid "Group By"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_automated_queue_activate_wizard_id
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_id
msgid "ID"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_automated_queue_activate_wizard___last_update
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue___last_update
msgid "Last Modified on"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_automated_queue_activate_wizard_write_uid
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_write_uid
msgid "Last Updated by"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_automated_queue_activate_wizard_write_date
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_write_date
msgid "Last Updated on"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_member_id
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_queue_view_search
msgid "Member"
msgstr ""
#. module: golem_activity_queue
#: code:addons/golem_activity_queue/models/golem_activity.py:108
#, python-format
msgid "No remaining place for the activity : {}, please discard changes and register in the queue."
msgstr ""
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_queue_view_search
msgid "Not Full Activity"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_activity_queue_ids
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_member_activity_queue_ids
msgid "Pending registration"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_activity_number
msgid "Pending registration number"
msgstr ""
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Queue"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_allowed
msgid "Queue allowed"
msgstr ""
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_member_form_inherit_golem_activity_queue
msgid "Queue list"
msgstr ""
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Register from Queue"
msgstr ""
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_automated_queue_actiave_wizard_view_form
msgid "Rejection reason"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_places_remain
msgid "Remaining places"
msgstr ""
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Remove Queue"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_season_id
msgid "Season"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model.fields,field_description:golem_activity_queue.field_golem_activity_queue_sequence
msgid "Sequence"
msgstr ""
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Switch to automated registration from queue"
msgstr ""
#. module: golem_activity_queue
#: model:ir.ui.view,arch_db:golem_activity_queue.golem_activity_form_inherit_golem_activity_queue
msgid "Switch to manual registration from queue"
msgstr ""
#. module: golem_activity_queue
#: code:addons/golem_activity_queue/models/golem_activity_queue.py:52
#, python-format
msgid "The member your trying to add to the queue is already registered for this activity"
msgstr ""
#. module: golem_activity_queue
#: code:addons/golem_activity_queue/models/golem_activity.py:118
#, python-format
msgid "There is a free place for the activity : {}, once you save it will be filled by the first member from queue"
msgstr ""
#. module: golem_activity_queue
#: code:addons/golem_activity_queue/models/golem_activity.py:122
#, python-format
msgid "There is a free place for the activity : {}, you may fill it manually from the queue"
msgstr ""
#. module: golem_activity_queue
#: code:addons/golem_activity_queue/models/golem_member.py:39
#, python-format
msgid "This activity : {} is already full, please discard changes and register in the queue."
msgstr ""
#. module: golem_activity_queue
#: code:addons/golem_activity_queue/models/golem_activity_queue.py:30
#: sql_constraint:golem.activity.queue:0
#, python-format
msgid "This member has already been registered for the queue."
msgstr ""
#. module: golem_activity_queue
#: code:addons/golem_activity_queue/models/golem_activity.py:112
#: code:addons/golem_activity_queue/models/golem_activity.py:127
#: code:addons/golem_activity_queue/models/golem_member.py:43
#, python-format
msgid "Warning"
msgstr ""
#. module: golem_activity_queue
#: model:ir.model,name:golem_activity_queue.model_golem_activity_automated_queue_activate_wizard
msgid "golem.activity.automated.queue.activate.wizard"
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 golem_activity_queue, golem_activity, golem_member

View File

@ -0,0 +1,130 @@
# -*- 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'
activity_queue_ids = fields.One2many('golem.activity.queue',
'activity_id', 'Pending registration')
queue_allowed = fields.Boolean(default=True, readonly=True)
auto_registration_from_queue = fields.Boolean(default=True, readonly=True)
queue_activity_number = fields.Integer(compute="_compute_queue_activity_number",
store=True, string='Pending registration number')
@api.multi
def auto_registration_toggle(self):
""" switch registration from queue mode """
for activity in self:
activity.auto_registration_from_queue = not activity.auto_registration_from_queue
@api.multi
def queue_allowed_toggle(self):
""" Toggle queue_alowed boolean """
self.ensure_one()
activity = self[0]
if activity.queue_allowed:
if len(activity.activity_queue_ids) > 0:
activity.activity_queue_ids.unlink()
activity.write({'queue_allowed': False,
'auto_registration_from_queue': False})
else:
return {
'name': _('Choose the activity to register in'),
'type': 'ir.actions.act_window',
'res_model': 'golem.activity.automated.queue.activate.wizard',
'view_mode': 'form',
'context': {'default_activity_id' : activity.id},
'target': 'new',
}
@api.multi
def register_from_queue(self):
""" Registers from queue """
for activity in self:
queues = activity.activity_queue_ids
if activity.queue_activity_number < activity.places_remain:
queues = queues[0:activity.queue_activity_number]
else:
queues = queues[0:activity.places_remain]
for queue in queues:
values = {'activity_id' : queue.activity_id.id,
'member_id' : queue.member_id.id}
self.env['golem.activity.registration'].create(values)
queue.unlink()
@api.constrains('activity_registration_ids')
def handle_queue_at_register(self):
""" Remove member from queue if he has been registered directly in
activity (only for manual queue processing) """
for activity in self:
member_ids = activity.activity_registration_ids.mapped('member_id.id')
queues_to_remove = activity.activity_queue_ids.filtered(
lambda q: q.member_id.id in member_ids)
queues_to_remove.unlink()
@api.constrains('activity_queue_ids', 'activity_registration_ids',
'places_remain', 'queue_allowed', 'queue_activity_number',
'auto_registration_from_queue')
def automated_register_from_queue(self):
"""automated registration from queue"""
for activity in self:
if (activity.places_remain and activity.queue_allowed and
activity.queue_activity_number > 0 and
activity.auto_registration_from_queue):
activity.register_from_queue()
@api.depends('activity_queue_ids')
def _compute_queue_activity_number(self):
""" compute number of queue registration for activity"""
for activity in self:
activity.queue_activity_number = len(activity.activity_queue_ids)
@api.onchange('activity_registration_ids')
def _check_registration_number(self):
for activity in self:
# Needed to ensure that we are negative in places
activity._compute_places_remain()
if activity.places_remain < 0 and activity.queue_allowed:
message = _('No remaining place for the activity : {}, please'
' discard changes and register in the queue.')
return {
'warning' : {
'title' : _('Warning'),
'message': message.format(activity.name),
}
}
elif activity.places_remain > 0 and activity.queue_activity_number > 0:
if activity.auto_registration_from_queue:
warning_message = _('There is a free place for the activity'
' : {}, once you save it will be filled'
' by the first member from queue')
else:
warning_message = _('There is a free place for the activity'
' : {}, you may fill it manually from '
'the queue')
return {
'warning' : {
'title' : _('Warning'),
'message': warning_message.format(activity.name)
}
}

View File

@ -0,0 +1,53 @@
# -*- 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 Queue """
from odoo import models, fields, api, _
from odoo.exceptions import ValidationError
class GolemActivityQueue(models.Model):
""" GOLEM Activity Queue """
_name = 'golem.activity.queue'
_order = 'sequence asc, id asc'
_description = 'GOLEM Activity Queue'
_sql_constraints = [('golem_activity_queue_uniq', 'UNIQUE (member_id, activity_id)',
_('This member has already been registered for the queue.'))]
member_id = fields.Many2one('golem.member', required=True,
string='Member', ondelete='cascade',
index=True)
activity_id = fields.Many2one('golem.activity', required=True,
string='Activity', ondelete='cascade',
index=True)
season_id = fields.Many2one(related='activity_id.season_id')
is_current = fields.Boolean('Current season?',
related='activity_id.is_current', store=True)
places_remain = fields.Integer(related='activity_id.places_remain')
sequence = fields.Integer()
@api.constrains('member_id', 'activity_id')
def check_member_registration(self):
""" Forbid registration in queue when member is already registred in the
activity """
for queue in self:
if queue.activity_id in \
queue.member_id.activity_registration_all_ids.mapped('activity_id'):
raise ValidationError(_('The member your trying to add to the queue'
' is already registered for this activity'))

View File

@ -0,0 +1,46 @@
# -*- 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 Member adaptations """
import logging
from odoo import models, fields, api, _
_LOGGER = logging.getLogger(__name__)
class GolemMember(models.Model):
""" GOLEM Member adaptations """
_inherit = 'golem.member'
activity_queue_ids = fields.One2many('golem.activity.queue', 'member_id',
string='Pending registration')
@api.onchange('activity_registration_ids')
def _check_registration_number(self):
""" check activity registration number """
for member in self:
for registration in member.activity_registration_ids:
activity = registration.activity_id
if activity.places_remain < 0 and activity.queue_allowed:
message = _('This activity : {} is already full, please'
' discard changes and register in the queue.')
return {
'warning' : {
'title' : _('Warning'),
'message': message.format(activity.name),
}
}

View File

@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
golem_activity_queue_user_rule,GOLEM Activity Queue User Rule,model_golem_activity_queue,golem_base.group_golem_user,1,1,1,1
golem_activity_queue_manager_rule,GOLEM Activity Queue Manager Rule,model_golem_activity_queue,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 golem_activity_queue_user_rule GOLEM Activity Queue User Rule model_golem_activity_queue golem_base.group_golem_user 1 1 1 1
3 golem_activity_queue_manager_rule GOLEM Activity Queue Manager Rule model_golem_activity_queue golem_base.group_golem_manager 1 1 1 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

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 test_golem_activity_queue, test_golem_activity, test_golem_member

View File

@ -0,0 +1,134 @@
# -*- 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 testing """
from odoo.tests.common import TransactionCase
class TestGolemActivity(TransactionCase):
""" GOLEM Activity Queue testing """
def setUp(self):
""" Bootstrap activity """
super(TestGolemActivity, self).setUp()
self.season = self.env['golem.season'].create({'name': u'Season 1'})
self.data_member_1 = {'lastname': u'LAST1',
'firstname': u'First1',
'season_ids':[(4, self.season.id, False)]}
self.data_member_2 = {'lastname': u'LAST2',
'firstname': u'First2',
'season_ids':[(4, self.season.id, False)]}
self.member = self.env['golem.member']
type_id = self.env.ref('golem_activity.golem_activity_type_activity')
self.data_activity = {
'name': u'Activity 1',
'season_id': self.season.id,
'type_id': type_id.id
}
self.activity = self.env['golem.activity']
self.activity_registration = self.env['golem.activity.registration']
self.activity_queue = self.env['golem.activity.queue']
def test_activity_creation(self):
""" Test activity defaults for queue """
activity = self.activity.create(self.data_activity)
self.assertTrue(activity.queue_allowed)
self.assertTrue(activity.auto_registration_from_queue)
self.assertEqual(activity.queue_activity_number, 0)
self.assertFalse(activity.activity_registration_ids)
self.assertFalse(activity.activity_queue_ids)
def test_auto_registration_toggle(self):
""" Test Toggle Autoregistration from queue """
activity = self.activity.create(self.data_activity)
self.assertTrue(activity.auto_registration_from_queue)
activity.auto_registration_toggle()
self.assertFalse(activity.auto_registration_from_queue)
activity.auto_registration_toggle()
self.assertTrue(activity.auto_registration_from_queue)
def test_queue_allowed_toggle(self):
""" Test Toggle queue_allowed """
#création de 2 membre est une activité
member1 = self.member.create(self.data_member_1)
member2 = self.member.create(self.data_member_2)
activity = self.activity.create(self.data_activity)
registration_data = {'activity_id' : activity.id, 'member_id' : member1.id}
queue_data = {'activity_id' : activity.id, 'member_id' : member2.id}
self.assertTrue(activity.queue_allowed)
activity.places = 1
self.activity_registration.create(registration_data)
self.activity_queue.create(queue_data)
self.assertTrue(activity.auto_registration_from_queue)
activity.queue_allowed_toggle()
self.assertFalse(activity.queue_allowed)
self.assertFalse(activity.activity_queue_ids)
queue_activate_wizard_model = self.env['golem.activity.automated.queue.activate.wizard']
queue_activate_wizard = queue_activate_wizard_model.create({'activity_id': activity.id})
queue_activate_wizard.activate_queue()
self.assertTrue(activity.queue_allowed)
self.assertTrue(activity.auto_registration_from_queue)
def test_auto_registration(self):
""" Test auto registration from queue """
member1 = self.member.create(self.data_member_1)
member2 = self.member.create(self.data_member_2)
activity = self.activity.create(self.data_activity)
self.assertTrue(activity.queue_allowed)
self.assertTrue(activity.auto_registration_from_queue)
registration_data = {'activity_id' : activity.id, 'member_id' : member1.id}
queue_data = {'activity_id' : activity.id, 'member_id' : member2.id}
activity.places = 1
registration = self.activity_registration.create(registration_data)
self.activity_queue.create(queue_data)
self.assertEqual(activity.activity_registration_ids[0].member_id, member1)
self.assertEqual(activity.activity_queue_ids[0].member_id, member2)
registration.unlink()
self.assertEqual(activity.activity_registration_ids[0].member_id, member2)
self.assertFalse(activity.activity_queue_ids)
def test_delete_queue_member(self):
""" Test Delete Queue member if they directly register """
member1 = self.member.create(self.data_member_1)
member2 = self.member.create(self.data_member_2)
activity = self.activity.create(self.data_activity)
self.assertTrue(activity.queue_allowed)
self.assertTrue(activity.auto_registration_from_queue)
activity.auto_registration_toggle()
self.assertFalse(activity.auto_registration_from_queue)
registration_data = {'activity_id' : activity.id, 'member_id' : member1.id}
queue_data = {'activity_id' : activity.id, 'member_id' : member2.id}
activity.places = 1
registration = self.activity_registration.create(registration_data)
self.activity_queue.create(queue_data)
self.assertEqual(activity.activity_registration_ids[0].member_id, member1)
self.assertEqual(activity.activity_queue_ids[0].member_id, member2)
registration.unlink()
activity.activity_registration_ids = [(0, False, queue_data)]
self.assertFalse(activity.activity_queue_ids)
self.assertEqual(activity.activity_registration_ids[0].member_id, member2)

View File

@ -0,0 +1,70 @@
# -*- 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 Queue testing """
from odoo.tests.common import TransactionCase
from odoo.exceptions import ValidationError
class TestGolemActivityQueue(TransactionCase):
""" GOLEM Activity Queue testing """
def setUp(self, *args, **kwargs):
""" Bootstrap ActivityQueue """
super(TestGolemActivityQueue, self).setUp(*args, **kwargs)
self.season = self.env['golem.season'].create({'name': u'Season 1'})
self.data_member_1 = {'lastname': u'LAST1',
'firstname': u'First1',
'season_ids':[(4, self.season.id, False)]}
self.data_member_2 = {'lastname': u'LAST2',
'firstname': u'First2',
'season_ids':[(4, self.season.id, False)]}
self.member = self.env['golem.member']
type_id = self.env.ref('golem_activity.golem_activity_type_activity')
self.data_activity = {
'name': u'Activity 1',
'season_id': self.season.id,
'type_id': type_id.id
}
self.activity = self.env['golem.activity']
self.activity_queue = self.env['golem.activity.queue']
self.activity_registration = self.env['golem.activity.registration']
def test_activity_queue_basic(self):
""" Test activity queue basics """
member1 = self.member.create(self.data_member_1)
activity = self.activity.create(self.data_activity)
activity.auto_registration_from_queue = False
activity_queue = self.activity_queue.create({'activity_id': activity.id,
'member_id': member1.id})
self.assertEqual(activity.activity_queue_ids[0], activity_queue)
self.assertEqual(member1.activity_queue_ids[0], activity_queue)
def test_check_member_registration(self):
""" Test activity queue fordib if already in activity """
member1 = self.member.create(self.data_member_1)
activity = self.activity.create(self.data_activity)
self.activity_registration.create({'activity_id': activity.id,
'member_id': member1.id})
self.assertEqual(activity.activity_registration_ids[0].member_id, member1)
with self.assertRaises(ValidationError) as err:
self.activity_queue.create({'activity_id': activity.id,
'member_id': member1.id})
self.assertIn('already registered for this activity', err.exception.args[0])

View File

@ -0,0 +1,74 @@
# -*- 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 Member testing """
from odoo.tests.common import TransactionCase
class TestGolemMember(TransactionCase):
""" GOLEM member testing """
def setUp(self, *args, **kwargs):
""" Bootstrap member """
super(TestGolemMember, self).setUp(*args, **kwargs)
#création du saison
self.season = self.env['golem.season'].create({'name': u'Season 1'})
self.data_member_1 = {'lastname': u'LAST1',
'firstname': u'First1',
'season_ids':[(4, self.season.id, False)]}
self.data_member_2 = {'lastname': u'LAST2',
'firstname': u'First2',
'season_ids':[(4, self.season.id, False)]}
self.member = self.env['golem.member']
type_id = self.env.ref('golem_activity.golem_activity_type_activity')
self.data_activity = {
'name': u'Activity 1',
'season_id': self.season.id,
'type_id': type_id.id
}
self.activity = self.env['golem.activity']
self.activity_registration = self.env['golem.activity.registration']
self.activity_queue = self.env['golem.activity.queue']
def test_member_creation(self):
""" Test member queue default """
member1 = self.member.create(self.data_member_1)
self.assertFalse(member1.activity_queue_ids)
def test_automated_registration(self):
""" Test automated registration """
member1 = self.member.create(self.data_member_1)
member2 = self.member.create(self.data_member_2)
activity = self.activity.create(self.data_activity)
registration_data = {'activity_id' : activity.id, 'member_id' : member1.id}
queue_data = {'activity_id' : activity.id, 'member_id' : member2.id}
self.assertTrue(activity.queue_allowed)
self.assertTrue(activity.auto_registration_from_queue)
activity.places = 1
registration = self.activity_registration.create(registration_data)
self.activity_queue.create(queue_data)
self.assertEqual(activity.activity_registration_ids[0].member_id, member1)
self.assertEqual(activity.activity_queue_ids[0].member_id, member2)
registration.unlink()
self.assertEqual(activity.activity_registration_ids[0].member_id, member2)
self.assertFalse(activity.activity_queue_ids)

View File

@ -0,0 +1,97 @@
<?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>
<!-- Form -->
<record model="ir.ui.view" id="golem_activity_queue_view_form">
<field name="name">GOLEM Activity Queue Form</field>
<field name="model">golem.activity.queue</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="activity_id"/>
<field name="season_id"/>
<field name="member_id"/>
</group>
</sheet>
</form>
</field>
</record>
<!-- Search -->
<record model="ir.ui.view" id="golem_activity_queue_view_search">
<field name="name">GOLEM Activity Queue Search</field>
<field name="model">golem.activity.queue</field>
<field name="arch" type="xml">
<search>
<field name="member_id"/>
<field name="activity_id"/>
<field name="season_id" />
<filter name="season_default" string="Default season"
domain="[('is_current', '=', True)]" />
<separator />
<filter name="activity_full" string="Full Activity"
domain="[('places_remain', '=', 0)]" />
<filter name="activity_nfull" string="Not Full Activity"
domain="[('places_remain', '&gt;', 0)]" />
<group string="Group By">
<filter name="group_by_member" string="Member"
context="{'group_by': 'member_id'}"/>
<filter name="group_by_activity" string="Activity"
context="{'group_by': 'activity_id'}"/>
</group>
</search>
</field>
</record>
<!-- Tree -->
<record model="ir.ui.view" id="golem_activity_queue_view_tree">
<field name="name">GOLEM Activity Queue Tree</field>
<field name="model">golem.activity.queue</field>
<field name="arch" type="xml">
<tree editable="top"
colors="grey: places_remain == 0; blue : places_remain &gt;= 1">
<field name="sequence" widget="handle"/>
<field name="member_id"/>
<field name="activity_id"
domain="[('places_remain','&lt;' , 1), ('queue_allowed', '=', True), ('is_current', '=', True)]"
options="{'no_create': True}"/>
<field name="season_id" readonly='1'/>
<field name="create_date" readonly="1"/>
<field name='places_remain' />
</tree>
</field>
</record>
<!-- Action -->
<act_window id="golem_activity_queue_action" name="Activity queue"
res_model="golem.activity.queue" view_mode="tree"
context="{'search_default_season_default': True}" />
<!-- Menu -->
<menuitem id="golem_activity_queue_menu" name="Activity queue"
parent="golem_activity.golem_activity_menu"
action="golem_activity_queue_action"
sequence="20" />
</data>
</odoo>

View File

@ -0,0 +1,81 @@
<?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_golem_activity_queue"
model="ir.ui.view">
<field name="name">Add the queue registration items to activity form</field>
<field name="model">golem.activity</field>
<field name="inherit_id" ref="golem_activity.golem_activity_form" />
<field name="arch" type="xml">
<field name="activity_registration_ids" position="after">
<button name="register_from_queue" colspan="2"
string="Add from queue" type="object"
attrs="{'invisible':['|', ('queue_allowed', '=', False), '|',
('places_remain','=', 0), ('queue_activity_number', '=', 0)]}"/>
</field>
<page name="invoicing" position="before">
<page name="queue" string="Queue">
<group>
<field name="queue_allowed" readonly='1'/>
<field name="auto_registration_from_queue" readonly='1'/>
</group>
<group attrs="{'invisible': [('queue_allowed', '=', False)]}">>
<field name="queue_activity_number" readonly='1'/>
<field name="activity_queue_ids"
context="{'default_activity_id': active_id}" >
<tree editable="top">
<field name="sequence" widget="handle"/>
<field name="member_id"/>
<field name="activity_id" readonly="1" />
<field name="season_id" readonly="1" />
</tree>
</field>
<button name="register_from_queue" colspan="2"
string="Register from Queue" type="object"
attrs="{'invisible':['|', ('queue_allowed', '=', False), '|',
('places_remain','=', 0), ('queue_activity_number', '=', 0)]}"/>
</group>
</page>
</page>
<header position="inside">
<button class="oe_highlight" name="queue_allowed_toggle"
string="Add Queue" type="object"
attrs="{'invisible': [('queue_allowed', '=', True)]}"/>
<button class="oe_highlight" name="queue_allowed_toggle"
string="Remove Queue" type="object"
attrs="{'invisible': [('queue_allowed', '=', False)]}"
confirm="Are you sure you want to remove queue from this activity ? This will delete all elements currently registred in"/>
<button name="auto_registration_toggle"
string="Switch to automated registration from queue" type="object"
attrs="{'invisible': ['|', ('queue_allowed', '=', False),'&amp;', ('queue_allowed', '=', True), ('auto_registration_from_queue', '=', True)]}"
confirm="Are you sure you want to switch to automated registration from queue mode ?"/>
<button name="auto_registration_toggle"
string="Switch to manual registration from queue" type="object"
attrs="{'invisible': ['|', ('queue_allowed', '=', False),'&amp;', ('queue_allowed', '=', True), ('auto_registration_from_queue', '=', False)]}"
confirm="Are you sure you want to switch to manual registration from queue mode ?"/>
</header>
</field>
</record>
</data>
</odoo>

View File

@ -0,0 +1,50 @@
<?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_member_form_inherit_golem_activity_queue"
model="ir.ui.view">
<field name="name">Queue adaptations on member form</field>
<field name="model">golem.member</field>
<field name="inherit_id" ref="golem_member.golem_member_form" />
<field name="arch" type="xml">
<page name="activities" position="after">
<page name="queue" string="Queue list">
<group>
<field name="activity_queue_ids"
context="{'default_member_id': active_id}">
<tree editable="top">
<field name="sequence" widget="handle"/>
<field name="activity_id"
domain="[('places_remain','&lt;' , 1), ('queue_allowed', '=', True), ('is_current', '=', True)]"
options="{'no_create': True}"/>
<field name="season_id" readonly="1" />
</tree>
</field>
</group>
</page>
</page>
</field>
</record>
</data>
</odoo>

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 golem_activity_automated_queue_activate

View File

@ -0,0 +1,37 @@
# -*- 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 Automated Queue Activation """
from odoo import models, fields
class GolemActivityAutomatedQueueActivateWizard(models.TransientModel):
""" GOLEM Activity Automated Queue wizard : activate automated queue processing """
_name = 'golem.activity.automated.queue.activate.wizard'
activity_id = fields.Many2one('golem.activity')
auto_registration_from_queue = fields.Boolean(default=True)
def activate_queue(self):
""" Activate Queue for the activity"""
self.ensure_one()
activation = self[0]
activation.activity_id.write({
'queue_allowed': True,
'auto_registration_from_queue': activation.auto_registration_from_queue
})

View File

@ -0,0 +1,47 @@
<?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_activity_automated_queue_actiave_wizard_view_form">
<field name="name">GOLEM Activity Automated Queue Activate Wizard Form</field>
<field name="model">golem.activity.automated.queue.activate.wizard</field>
<field name="arch" type="xml">
<form string="Rejection reason">
<p colspan="2">
Are you sure you want to Add queue to this activity ?<br />
If yes please confirm if you want automated registration from queue to activity.
</p>
<group>
<field name="activity_id" invisible="1" />
<field name="auto_registration_from_queue"/>
</group>
<footer>
<button name="activate_queue" string="Confirm" type="object"
class="oe_highlight" />
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
</data>
</odoo>

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, wizard

View File

@ -0,0 +1,36 @@
# -*- 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 non-profit resources',
'summary': 'GOLEM resources management',
'description': ''' GOLEM resources management ''',
'version': '10.0.1.6.2',
'category': 'GOLEM',
'author': 'Youssef El Ouahby, Fabien Bourgeois',
'license': 'AGPL-3',
'application': True,
'installable': True,
'depends': ['product'],
'data': ['views/golem_resource_views.xml',
'views/golem_resource_type_views.xml',
'views/golem_resource_reservation_views.xml',
'views/golem_resource_timetable_views.xml',
'wizard/golem_reservation_rejection_views.xml',
'security/ir.model.access.csv']
}

488
golem_resource/i18n/fr.po Normal file
View File

@ -0,0 +1,488 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * golem_resource
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-19 08:39+0000\n"
"PO-Revision-Date: 2018-02-19 08:39+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_resource
#: model:ir.model.fields,help:golem_resource.field_golem_resource_product_tmpl_id
msgid "A generic product can be linked, in order to sell reservations (work in progress)"
msgstr "Un article générique peut être lié, dans l'objectif de monétiser des réservations (à venir)"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_active
msgid "Active"
msgstr "Actif"
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_search
msgid "Archived"
msgstr "Archivé"
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_form
msgid "Availibility configuration"
msgstr "Configuration des disponibilités"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_avaibility_start
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_resource_avaibility_start
msgid "Availibility start date"
msgstr "Début de disponibilité"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_avaibility_stop
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_resource_avaibility_stop
msgid "Availibility stop date"
msgstr "Fin de disponibilité"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_resource_timetable_ids
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_ids
msgid "Availibility timetable"
msgstr "Tableau des disponibilités"
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_reservation_rejection_wizard_view_form
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form
msgid "Cancel"
msgstr "Annuler"
#. module: golem_resource
#: selection:golem.resource.reservation,state:0
msgid "Canceled"
msgstr "Annulé"
#. module: golem_resource
#: model:ir.ui.menu,name:golem_resource.resource_configuration_menu
msgid "Configuration"
msgstr "Configuration"
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form
msgid "Confirm"
msgstr "Confirmer"
#. module: golem_resource
#: selection:golem.resource.reservation,state:0
msgid "Confirmed"
msgstr "Confirmé"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard_create_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_create_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_create_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_create_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_type_create_uid
msgid "Created by"
msgstr "Créé par"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard_create_date
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_create_date
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_create_date
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_create_date
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_type_create_date
msgid "Created on"
msgstr "Créé le"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_date
msgid "Date"
msgstr "Date"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_date_start
msgid "Date start"
msgstr "Date de début"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_date_stop
msgid "Date stop"
msgstr "Date de fin"
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Day"
msgstr "Jour"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard_display_name
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_display_name
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_display_name
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_display_name
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_type_display_name
msgid "Display Name"
msgstr "Nom affiché"
#. module: golem_resource
#: selection:golem.resource.reservation,state:0
msgid "Draft"
msgstr "Brouillon"
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource.py:63
#, python-format
msgid "End availibility should be after than start availibility"
msgstr "La fin de disponibilité ne peut pas être après le début"
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_reservation.py:107
#: code:addons/golem_resource/models/golem_resource_timetable.py:55
#, python-format
msgid "End time should be after than start time"
msgstr "L'heure de fin ne peut pas être après l'heure de début"
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_timetable.py:37
#: selection:golem.resource.timetable,weekday:0
#, python-format
msgid "Friday"
msgstr "Vendredi"
#. module: golem_resource
#: model:ir.model,name:golem_resource.model_golem_resource_reservation
msgid "GOLEM Reservation Model"
msgstr "GOLEM Reservation Model"
#. module: golem_resource
#: model:ir.model,name:golem_resource.model_golem_resource
msgid "GOLEM Resource Model"
msgstr "GOLEM Resource Model"
#. module: golem_resource
#: model:ir.model,name:golem_resource.model_golem_resource_type
msgid "GOLEM Resource Type"
msgstr "GOLEM Resource Type"
#. module: golem_resource
#: model:ir.model,name:golem_resource.model_golem_resource_timetable
msgid "Golem Timetable"
msgstr "Golem Timetable"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard_id
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_id
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_id
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_id
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_type_id
msgid "ID"
msgstr "ID"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_validation_required
msgid "Is validation required ?"
msgstr "Une validation est-elle nécessaire ?"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard___last_update
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource___last_update
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation___last_update
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable___last_update
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_type___last_update
msgid "Last Modified on"
msgstr "Dernière Modification le"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard_write_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_write_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_write_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_type_write_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_write_uid
msgid "Last Updated by"
msgstr "Dernière mise à jour par"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard_write_date
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_write_date
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_write_date
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_type_write_date
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_write_date
msgid "Last Updated on"
msgstr "Dernière mise à jour le"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_product_tmpl_id
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_search
msgid "Linked product"
msgstr "Article lié"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_resource_id
msgid "Linked resource"
msgstr "Ressource liée"
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_timetable.py:33
#: selection:golem.resource.timetable,weekday:0
#, python-format
msgid "Monday"
msgstr "Lundi"
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Month"
msgstr "Mois"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_name
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_name
msgid "Name"
msgstr "Nom"
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_reservation.py:195
#, python-format
msgid "Not allowed, the resource is already taken during this period : from {} to {} this day, please choose another périod before confirming."
msgstr "Interdit : la ressource est déjà réservée durant cette période : de {} à {} ce jour, merci de choisir une autre période avant de confirmer."
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_reservation.py:177
#, python-format
msgid "Not allowed, the resource is not available during this period, please choose another time before confirming."
msgstr "Interdit : la ressource n'est pas disponible durant cette période, merci de choisir d'autres horaires avant de confirmer à nouveau."
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_reservation.py:164
#, python-format
msgid "Not allowed, the resource is not available in this period, please choose another périod before confirming"
msgstr "Interdit : la ressource n'est pas disponible durant cette période, merci de choisir d'autres dates avant de confirmer à nouveau."
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_reservation.py:182
#, python-format
msgid "Not allowed, the resource is not available this day. Please choose another date."
msgstr "Interdit : la ressource n'est pas disponible ce jour de la semaine. Merci de choisir un autre jour."
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_partner_id
msgid "On behalf of"
msgstr "Pour le compte de"
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Partner"
msgstr "Partenaire"
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_reservation.py:139
#, python-format
msgid "Please enter the rejection reason"
msgstr "Merci de saisir le motif du refus"
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_form
msgid "Please save the resource before fixing the timetable availibility\""
msgstr "Merci de sauvegarder la ressource avant de pouvoir définir ses disponibilités\""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard_reason
msgid "Reason"
msgstr "Motif"
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_reservation_rejection_wizard_view_form
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form
msgid "Reject"
msgstr "Rejet"
#. module: golem_resource
#: selection:golem.resource.reservation,state:0
msgid "Rejected"
msgstr "Rejeté"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_rejection_reason
#: model:ir.ui.view,arch_db:golem_resource.golem_reservation_rejection_wizard_view_form
msgid "Rejection reason"
msgstr "Motif du rejet"
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form
msgid "Reservation"
msgstr "Réservation"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard_reservation_id
msgid "Reservation id"
msgstr "Reservation id"
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Reservation to Validate"
msgstr "Réservation à valider"
#. module: golem_resource
#: model:ir.actions.act_window,name:golem_resource.golem_resource_reservation_action
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_ids
#: model:ir.ui.menu,name:golem_resource.golem_resource_reservation_menu
msgid "Reservations"
msgstr "Réservations"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_resource_id
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Resource"
msgstr "Ressource"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_type_id_4449
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_type_name
msgid "Resource Type"
msgstr "Type de ressource"
#. module: golem_resource
#: model:ir.actions.act_window,name:golem_resource.golem_resource_type_action
#: model:ir.ui.menu,name:golem_resource.resource_cofiguration_type_menu
msgid "Resource Types"
msgstr "Types de ressource"
#. module: golem_resource
#: sql_constraint:golem.resource.type:0
msgid "Resource type must be unique."
msgstr "Le type de ressource doit être unique."
#. module: golem_resource
#: model:ir.actions.act_window,name:golem_resource.golem_resource_action
#: model:ir.ui.menu,name:golem_resource.golem_resource_menu
#: model:ir.ui.menu,name:golem_resource.resource_list_menu
msgid "Resources"
msgstr "Resources"
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_timetable.py:38
#: selection:golem.resource.timetable,weekday:0
#, python-format
msgid "Saturday"
msgstr "Samedi"
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form
msgid "Set to draft"
msgstr "Brouillon"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_time_start
msgid "Start"
msgstr "Début"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_hour_start
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_timetable_view_tree
msgid "Start hour"
msgstr "Heure de début"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_state
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "State"
msgstr "État"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_time_stop
msgid "Stop"
msgstr "Fin"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_hour_stop
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_timetable_view_tree
msgid "Stop hour"
msgstr "Heure de fin"
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_timetable.py:39
#: selection:golem.resource.timetable,weekday:0
#, python-format
msgid "Sunday"
msgstr "Dimanche"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_supervisor_id
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_search
msgid "Supervisor"
msgstr "Responsable"
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_timetable.py:36
#: selection:golem.resource.timetable,weekday:0
#, python-format
msgid "Thursday"
msgstr "Jeudi"
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_timetable.py:34
#: selection:golem.resource.timetable,weekday:0
#, python-format
msgid "Tuesday"
msgstr "Mardi"
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_search
msgid "Type"
msgstr "Type"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_user_id
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "User"
msgstr "Utilisateur"
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form
msgid "Validate"
msgstr "Valider"
#. module: golem_resource
#: selection:golem.resource.reservation,state:0
msgid "Validated"
msgstr "Validé"
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_timetable.py:35
#: selection:golem.resource.timetable,weekday:0
#, python-format
msgid "Wednesday"
msgstr "Mercredi"
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Week"
msgstr "Semaine"
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_weekday
msgid "Weekday"
msgstr "Jour"
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_search
msgid "With validation"
msgstr "Avec validation"
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_search
msgid "Without validation"
msgstr "Sans validation"
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_reservation.py:153
#, python-format
msgid "You do not have permissions to validate or reject a reservation."
msgstr "Vous n'avez pas les autorisations nécessaires pour valider ou rejeter une réservation."
#. module: golem_resource
#: model:ir.model,name:golem_resource.model_golem_reservation_rejection_wizard
msgid "golem.reservation.rejection.wizard"
msgstr "golem.reservation.rejection.wizard"

View File

@ -0,0 +1,489 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * golem_resource
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-19 08:39+0000\n"
"PO-Revision-Date: 2018-02-19 08:39+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_resource
#: model:ir.model.fields,help:golem_resource.field_golem_resource_product_tmpl_id
msgid "A generic product can be linked, in order to sell reservations (work in progress)"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_active
msgid "Active"
msgstr ""
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_search
msgid "Archived"
msgstr ""
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_form
msgid "Availibility configuration"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_avaibility_start
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_resource_avaibility_start
msgid "Availibility start date"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_avaibility_stop
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_resource_avaibility_stop
msgid "Availibility stop date"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_resource_timetable_ids
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_ids
msgid "Availibility timetable"
msgstr ""
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_reservation_rejection_wizard_view_form
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form
msgid "Cancel"
msgstr ""
#. module: golem_resource
#: selection:golem.resource.reservation,state:0
msgid "Canceled"
msgstr ""
#. module: golem_resource
#: model:ir.ui.menu,name:golem_resource.resource_configuration_menu
msgid "Configuration"
msgstr ""
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form
msgid "Confirm"
msgstr ""
#. module: golem_resource
#: selection:golem.resource.reservation,state:0
msgid "Confirmed"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard_create_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_create_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_create_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_create_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_type_create_uid
msgid "Created by"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard_create_date
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_create_date
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_create_date
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_create_date
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_type_create_date
msgid "Created on"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_date
msgid "Date"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_date_start
msgid "Date start"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_date_stop
msgid "Date stop"
msgstr ""
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Day"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard_display_name
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_display_name
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_display_name
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_display_name
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_type_display_name
msgid "Display Name"
msgstr ""
#. module: golem_resource
#: selection:golem.resource.reservation,state:0
msgid "Draft"
msgstr ""
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource.py:63
#, python-format
msgid "End availibility should be after than start availibility"
msgstr ""
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_reservation.py:107
#: code:addons/golem_resource/models/golem_resource_timetable.py:55
#, python-format
msgid "End time should be after than start time"
msgstr ""
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_timetable.py:37
#: selection:golem.resource.timetable,weekday:0
#, python-format
msgid "Friday"
msgstr ""
#. module: golem_resource
#: model:ir.model,name:golem_resource.model_golem_resource_reservation
msgid "GOLEM Reservation Model"
msgstr ""
#. module: golem_resource
#: model:ir.model,name:golem_resource.model_golem_resource
msgid "GOLEM Resource Model"
msgstr ""
#. module: golem_resource
#: model:ir.model,name:golem_resource.model_golem_resource_type
msgid "GOLEM Resource Type"
msgstr ""
#. module: golem_resource
#: model:ir.model,name:golem_resource.model_golem_resource_timetable
msgid "Golem Timetable"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard_id
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_id
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_id
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_id
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_type_id
msgid "ID"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_validation_required
msgid "Is validation required ?"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard___last_update
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource___last_update
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation___last_update
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable___last_update
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_type___last_update
msgid "Last Modified on"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard_write_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_write_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_write_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_type_write_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_write_uid
msgid "Last Updated by"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard_write_date
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_write_date
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_write_date
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_type_write_date
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_write_date
msgid "Last Updated on"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_product_tmpl_id
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_search
msgid "Linked product"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_resource_id
msgid "Linked resource"
msgstr ""
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_timetable.py:33
#: selection:golem.resource.timetable,weekday:0
#, python-format
msgid "Monday"
msgstr ""
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Month"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_name
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_name
msgid "Name"
msgstr ""
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_reservation.py:195
#, python-format
msgid "Not allowed, the resource is already taken during this period : from {} to {} this day, please choose another périod before confirming."
msgstr ""
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_reservation.py:177
#, python-format
msgid "Not allowed, the resource is not available during this period, please choose another time before confirming."
msgstr ""
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_reservation.py:164
#, python-format
msgid "Not allowed, the resource is not available in this period, please choose another périod before confirming"
msgstr ""
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_reservation.py:182
#, python-format
msgid "Not allowed, the resource is not available this day. Please choose another date."
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_partner_id
msgid "On behalf of"
msgstr ""
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Partner"
msgstr ""
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_reservation.py:139
#, python-format
msgid "Please enter the rejection reason"
msgstr ""
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_form
msgid "Please save the resource before fixing the timetable availibility\""
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard_reason
msgid "Reason"
msgstr ""
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_reservation_rejection_wizard_view_form
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form
msgid "Reject"
msgstr ""
#. module: golem_resource
#: selection:golem.resource.reservation,state:0
msgid "Rejected"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_rejection_reason
#: model:ir.ui.view,arch_db:golem_resource.golem_reservation_rejection_wizard_view_form
msgid "Rejection reason"
msgstr ""
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form
msgid "Reservation"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard_reservation_id
msgid "Reservation id"
msgstr ""
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Reservation to Validate"
msgstr ""
#. module: golem_resource
#: model:ir.actions.act_window,name:golem_resource.golem_resource_reservation_action
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_ids
#: model:ir.ui.menu,name:golem_resource.golem_resource_reservation_menu
msgid "Reservations"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_resource_id
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Resource"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_type_id_4449
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_type_name
msgid "Resource Type"
msgstr ""
#. module: golem_resource
#: model:ir.actions.act_window,name:golem_resource.golem_resource_type_action
#: model:ir.ui.menu,name:golem_resource.resource_cofiguration_type_menu
msgid "Resource Types"
msgstr ""
#. module: golem_resource
#: sql_constraint:golem.resource.type:0
msgid "Resource type must be unique."
msgstr ""
#. module: golem_resource
#: model:ir.actions.act_window,name:golem_resource.golem_resource_action
#: model:ir.ui.menu,name:golem_resource.golem_resource_menu
#: model:ir.ui.menu,name:golem_resource.resource_list_menu
msgid "Resources"
msgstr ""
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_timetable.py:38
#: selection:golem.resource.timetable,weekday:0
#, python-format
msgid "Saturday"
msgstr ""
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form
msgid "Set to draft"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_time_start
msgid "Start"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_hour_start
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_timetable_view_tree
msgid "Start hour"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_state
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "State"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_time_stop
msgid "Stop"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_hour_stop
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_timetable_view_tree
msgid "Stop hour"
msgstr ""
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_timetable.py:39
#: selection:golem.resource.timetable,weekday:0
#, python-format
msgid "Sunday"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_supervisor_id
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_search
msgid "Supervisor"
msgstr ""
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_timetable.py:36
#: selection:golem.resource.timetable,weekday:0
#, python-format
msgid "Thursday"
msgstr ""
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_timetable.py:34
#: selection:golem.resource.timetable,weekday:0
#, python-format
msgid "Tuesday"
msgstr ""
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_search
msgid "Type"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_user_id
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "User"
msgstr ""
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form
msgid "Validate"
msgstr ""
#. module: golem_resource
#: selection:golem.resource.reservation,state:0
msgid "Validated"
msgstr ""
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_timetable.py:35
#: selection:golem.resource.timetable,weekday:0
#, python-format
msgid "Wednesday"
msgstr ""
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Week"
msgstr ""
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_weekday
msgid "Weekday"
msgstr ""
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_search
msgid "With validation"
msgstr ""
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_search
msgid "Without validation"
msgstr ""
#. module: golem_resource
#: code:addons/golem_resource/models/golem_resource_reservation.py:153
#, python-format
msgid "You do not have permissions to validate or reject a reservation."
msgstr ""
#. module: golem_resource
#: model:ir.model,name:golem_resource.model_golem_reservation_rejection_wizard
msgid "golem.reservation.rejection.wizard"
msgstr ""

View File

@ -0,0 +1,22 @@
# -*- 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 golem_resource_type, \
golem_resource_timetable, \
golem_resource, \
golem_resource_reservation

View File

@ -0,0 +1,64 @@
# -*- 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 Resources management """
from odoo import models, fields, api
from odoo.exceptions import ValidationError
class GolemResource(models.Model):
""" GOLEM Resource Model """
_name = 'golem.resource'
_description = 'GOLEM Resource Model'
_inherit = 'mail.thread'
_order = 'name asc'
name = fields.Char(required=True, index=True)
active = fields.Boolean(default=True)
validation_required = fields.Boolean(default=False,
string='Is validation required ?')
type_id = fields.Many2one('golem.resource.type',
index=True, string='Resource Type')
supervisor_id = fields.Many2one('res.partner', index=True, string='Supervisor')
product_tmpl_id = fields.Many2one('product.template', index=True,
string='Linked product',
help='A generic product can be linked, in '
'order to sell reservations (work in '
'progress)')
avaibility_start = fields.Date(required=True, string='Availibility start date')
avaibility_stop = fields.Date(required=True, string='Availibility stop date')
timetable_ids = fields.One2many('golem.resource.timetable', 'resource_id',
string='Availibility timetable')
reservation_ids = fields.One2many('golem.resource.reservation', 'resource_id',
string='Reservations')
@api.multi
def active_toggle(self):
""" Toggles active boolean """
for resource in self:
resource.active = not resource.active
@api.constrains('avaibility_start', 'avaibility_stop')
def _check_date_consistency(self):
""" Checks date consistency """
for resource in self:
if resource.avaibility_stop <= resource.avaibility_start:
raise ValidationError(_('End availibility should be after than '
'start availibility'))

View File

@ -0,0 +1,199 @@
# -*- 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 Resource Reservation """
from math import modf
from odoo import models, fields, api, _
from odoo.exceptions import ValidationError
class GolemResourceReservation(models.Model):
""" GOLEM Resource Reservation Model """
_name = 'golem.resource.reservation'
_description = 'GOLEM Reservation Model'
_inherit = 'mail.thread'
_order = 'date desc,hour_start asc'
name = fields.Char(compute='_compute_name', store=True)
# TODO: handle multiple days reservation
date = fields.Date(required=True, index=True, readonly=True,
states={'draft': [('readonly', False)]})
hour_start = fields.Float('Start hour', required=True, readonly=True,
states={'draft': [('readonly', False)]})
hour_stop = fields.Float('Stop hour', required=True, readonly=True,
states={'draft': [('readonly', False)]})
date_start = fields.Datetime(compute='_compute_date_start', store=True, index=True)
date_stop = fields.Datetime(compute='_compute_date_stop', store=True, index=True)
resource_id = fields.Many2one('golem.resource', required=True, index=True,
string='Resource', readonly=True,
track_visibility='onchange',
states={'draft': [('readonly', False)]})
resource_avaibility_start = fields.Date(related='resource_id.avaibility_start')
resource_avaibility_stop = fields.Date(related='resource_id.avaibility_stop')
resource_timetable_ids = fields.One2many(related='resource_id.timetable_ids')
user_id = fields.Many2one('res.users', required=True, index=True, readonly=True,
string='User', default=lambda self: self.env.user,
states={'draft': [('readonly', False)]})
partner_id = fields.Many2one('res.partner', string='On behalf of',
required=True, index=True, readonly=True,
track_visibility='onchange',
states={'draft': [('readonly', False)]})
state = fields.Selection([('canceled', 'Canceled'),
('draft', 'Draft'),
('confirmed', 'Confirmed'),
('validated', 'Validated'),
('rejected', 'Rejected')],
default='draft', track_visibility='onchange')
rejection_reason = fields.Text(readonly=True, track_visibility='onchange')
@api.depends('resource_id', 'date')
def _compute_name(self):
""" Computes reservation name """
for reservation in self:
reservation.name = u'{}/{}'.format(reservation.resource_id.name,
reservation.date)
@api.depends('date', 'hour_start')
def _compute_date_start(self):
""" Computes Date start """
for reservation in self:
minute_start, hour_start = modf(reservation.hour_start)
hour_start = int(hour_start)
minute_start = int(round(minute_start * 60))
reservation.date_start = u'{} {}:{}:00'.format(reservation.date,
hour_start, minute_start)
@api.depends('date', 'hour_stop')
def _compute_date_stop(self):
""" Computes Date stop """
for reservation in self:
minute_stop, hour_stop = modf(reservation.hour_stop)
hour_stop = int(hour_stop)
minute_stop = int(round(minute_stop * 60))
reservation.date_stop = u'{} {}:{}:00'.format(reservation.date,
hour_stop, minute_stop)
@api.onchange('hour_start')
def onchange_hour_start(self):
""" Propose automatically stop hour after start hour had been filled """
for reservation in self:
if reservation.hour_start and not reservation.hour_stop:
reservation.hour_stop = reservation.hour_start + 1
@api.constrains('hour_start', 'hour_stop')
def _check_hour_consistency(self):
""" Checks hour consistency """
for reservation in self:
if reservation.hour_stop <= reservation.hour_start:
raise ValidationError(_('End time should be after than start time'))
@api.multi
def state_draft(self):
""" Status to draft """
self.write({'state': 'draft'})
@api.multi
def state_confirm(self):
""" Confirms reservation, or validates it if not workflow is involved """
for reservation in self:
# Needed, for constraint checking
reservation.state = 'confirmed'
if not reservation.resource_id.validation_required:
reservation.state = 'validated'
@api.multi
def state_canceled(self):
""" Status to cancel """
self.write({'state': 'canceled'})
@api.multi
def state_validated(self):
""" Status to validated """
self.write({'state': 'validated'})
@api.multi
def state_rejected(self):
""" Wizard call for reservation reject """
self.ensure_one()
reservation_id = self[0]
return {'name' : _('Please enter the rejection reason'),
'type' : 'ir.actions.act_window',
'res_model' : 'golem.reservation.rejection.wizard',
'context': {'default_reservation_id': reservation_id.id},
'view_mode': 'form',
'target': 'new'}
@api.constrains('state')
def check_access(self):
""" Checks access when state is updated """
reservation = self[0]
if reservation.state in ('rejected', 'validated'):
if not self.env.user.has_group('golem_base.group_golem_manager'):
verr = _('You do not have permissions to validate or reject a reservation.')
raise ValidationError(verr)
@api.constrains('state')
def check_confirmed(self):
""" Check date coherence on reservation confirmation """
for reservation in self:
if reservation.state == 'confirmed':
# Check is reservation is not taking place out of the resource avaibility period
if reservation.date < reservation.resource_id.avaibility_start or \
reservation.date > reservation.resource_id.avaibility_stop:
verr = _('Not allowed, the resource is not available in '
'this period, please choose another périod before '
'confirming')
raise ValidationError(verr)
# Check if reservation is not taking place out the avaibility timetables
is_day_allowed = False
for timetable in reservation.resource_id.timetable_ids:
# Check for the time according to resource timetable avaibility
date = fields.Datetime.from_string(reservation.date)
if int(timetable.weekday) == date.weekday():
is_day_allowed = True
if reservation.hour_start < timetable.time_start or \
reservation.hour_stop > timetable.time_stop:
verr = _('Not allowed, the resource is not available '
'during this period, please choose another '
'time before confirming.')
raise ValidationError(verr)
if not is_day_allowed:
verr = _('Not allowed, the resource is not available '
'this day. Please choose another date.')
raise ValidationError(verr)
# Check if the resource is already taken during this period
# PERF : check the date, not iterate over all reservations
domain = [('resource_id', '=', reservation.resource_id.id),
('date', '=', reservation.date),
('state', 'in', ('confirmed', 'validated')),
('id', '!=', reservation.id)]
reservations = self.env['golem.resource.reservation'].search(domain)
for other_res in reservations:
if (other_res.hour_start < reservation.hour_start < other_res.hour_stop) or \
(other_res.hour_start < reservation.hour_stop < other_res.hour_stop):
verr = _('Not allowed, the resource is already taken '
'during this period : from {} to {} this day, '
'please choose another périod before confirming.')
raise ValidationError(verr.format(other_res.date_start,
other_res.date_stop))

View File

@ -0,0 +1,55 @@
# -*- 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 Resource Timetable """
from odoo import models, fields, api, _
from odoo.exceptions import ValidationError
class GolemTimetable(models.Model):
""" Golem Timetable """
_name = "golem.resource.timetable"
_description = "Golem Timetable"
_rec_name = 'weekday'
_order = 'weekday asc,time_start asc'
resource_id = fields.Many2one('golem.resource', required=True,
string='Linked resource')
weekday = fields.Selection([('0', _('Monday')),
('1', _('Tuesday')),
('2', _('Wednesday')),
('3', _('Thursday')),
('4', _('Friday')),
('5', _('Saturday')),
('6', _('Sunday'))], required=True)
time_start = fields.Float(required=True, string='Start')
time_stop = fields.Float(required=True, string='Stop')
@api.onchange('time_start')
def onchange_time_start(self):
""" Propose automatically stop hour after start hour had been filled """
for line in self:
if line.time_start and not line.time_stop:
line.time_stop = line.time_start + 1
@api.constrains('time_start', 'time_stop')
def _check_time_consistency(self):
""" Checks time consistency """
for timetable in self:
if timetable.time_stop <= timetable.time_start:
raise ValidationError(_('End time should be after than start time'))

View File

@ -0,0 +1,32 @@
# -*- 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 Resource Type """
from odoo import models, fields
class GolemResourceType(models.Model):
""" GOLEM Resource Type """
_name = 'golem.resource.type'
_description = 'GOLEM Resource Type'
_order = 'name asc'
_sql_constraints = [('golem_resource_type_name_uniq',
'UNIQUE (name)',
'Resource type must be unique.')]
name = fields.Char(string='Resource Type', required=True, index=True)

View File

@ -0,0 +1,9 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_golem_resource_user,Access GOLEM Resource User,model_golem_resource,golem_base.group_golem_user,1,0,0,0
access_golem_resource_manager,Access GOLEM Resource Manager,model_golem_resource,golem_base.group_golem_manager,1,1,1,1
access_golem_resource_type_user,Access GOLEM Resource Type User,model_golem_resource_type,golem_base.group_golem_user,1,0,0,0
access_golem_resource_type_manager,Access GOLEM Resource Type Manager,model_golem_resource_type,golem_base.group_golem_manager,1,1,1,1
access_golem_resource_reservation_user,Access GOLEM Resource Reservation User,model_golem_resource_reservation,golem_base.group_golem_user,1,1,1,0
access_golem_resource_reservation_manager,Access GOLEM Resource Reservation Manager,model_golem_resource_reservation,golem_base.group_golem_manager,1,1,1,1
access_golem_resource_timetable_user,Access GOLEM Resource Timetable User,model_golem_resource_timetable,golem_base.group_golem_user,1,0,0,0
access_golem_resource_timetable_manager,Access GOLEM Resource Timetable Manager,model_golem_resource_timetable,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_resource_user Access GOLEM Resource User model_golem_resource golem_base.group_golem_user 1 0 0 0
3 access_golem_resource_manager Access GOLEM Resource Manager model_golem_resource golem_base.group_golem_manager 1 1 1 1
4 access_golem_resource_type_user Access GOLEM Resource Type User model_golem_resource_type golem_base.group_golem_user 1 0 0 0
5 access_golem_resource_type_manager Access GOLEM Resource Type Manager model_golem_resource_type golem_base.group_golem_manager 1 1 1 1
6 access_golem_resource_reservation_user Access GOLEM Resource Reservation User model_golem_resource_reservation golem_base.group_golem_user 1 1 1 0
7 access_golem_resource_reservation_manager Access GOLEM Resource Reservation Manager model_golem_resource_reservation golem_base.group_golem_manager 1 1 1 1
8 access_golem_resource_timetable_user Access GOLEM Resource Timetable User model_golem_resource_timetable golem_base.group_golem_user 1 0 0 0
9 access_golem_resource_timetable_manager Access GOLEM Resource Timetable Manager model_golem_resource_timetable golem_base.group_golem_manager 1 1 1 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

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 test_golem_resource, test_golem_resource_timetable, test_golem_resource_reservation

View File

@ -0,0 +1,69 @@
# -*- 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 Resource testing """
from odoo.tests.common import TransactionCase
from odoo.exceptions import ValidationError
class TestGolemResource(TransactionCase):
""" GOLEM Resource testing """
def setUp(self, *args, **kwargs):
""" Bootstrap Resource """
super(TestGolemResource, self).setUp(*args, **kwargs)
self.data = {
'name': 'Resource',
'avaibility_start': '2018-01-01',
'avaibility_stop': '2020-01-01'
}
self.resource_obj = self.env['golem.resource']
def test_resource_basic(self):
""" Test resource bases """
resource = self.resource_obj.create(self.data)
self.assertTrue(resource.active)
self.assertFalse(resource.validation_required)
self.assertEqual(resource.avaibility_start, '2018-01-01')
self.assertEqual(resource.avaibility_stop, '2020-01-01')
self.assertFalse(resource.supervisor_id)
self.assertFalse(resource.product_tmpl_id)
self.assertFalse(resource.timetable_ids)
self.assertFalse(resource.reservation_ids)
def test_resource_active(self):
""" Test resource active """
resource = self.resource_obj.create(self.data)
self.assertTrue(resource.active)
resource.active_toggle()
self.assertFalse(resource.active)
resource.active_toggle()
self.assertTrue(resource.active)
def test_resource_dates(self):
""" Test resource dates : stop can not be after start """
self.data.update({'avaibility_stop': '2017-01-01'})
with self.assertRaises(ValidationError):
self.resource_obj.create(self.data)
def test_resource_dates_equal(self):
""" Test resource dates : stop can not be equal to start """
self.data.update({'avaibility_stop': self.data['avaibility_start']})
with self.assertRaises(ValidationError):
self.resource_obj.create(self.data)

View File

@ -0,0 +1,186 @@
# -*- 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 Resource Reservation testing """
import logging
from odoo.tests.common import TransactionCase
from odoo.exceptions import ValidationError
_LOGGER = logging.getLogger(__name__)
class TestGolemResourceReservation(TransactionCase):
""" GOLEM Resource Reservation testing """
def setUp(self, *args, **kwargs):
""" Bootstrap Resource Reservation """
super(TestGolemResourceReservation, self).setUp(*args, **kwargs)
self.resource = self.env['golem.resource'].create({
'name': 'Resource',
'avaibility_start': '2018-01-01',
'avaibility_stop': '2020-01-01'
})
self.resource_val = self.env['golem.resource'].create({
'name': 'Resource to validate',
'avaibility_start': '2018-01-01',
'avaibility_stop': '2020-01-01',
'validation_required': True
})
self.timetable_obj = self.env['golem.resource.timetable']
timetable_data = {'resource_id': self.resource.id, 'weekday': '0',
'time_start': 8.0, 'time_stop': 12.0}
self.timetable_obj.create(timetable_data)
timetable_data['resource_id'] = self.resource_val.id
self.timetable_obj.create(timetable_data)
self.partner = self.env['res.partner'].create({'firstname': 'John',
'lastname': 'DOE',
'is_company': False})
self.data = {
'resource_id': self.resource.id,
'date': '2018-02-05', # is monday
'hour_start': 11.0,
'hour_stop': 12.0,
'partner_id': self.partner.id
}
self.res_obj = self.env['golem.resource.reservation']
def test_reservation_basic(self):
""" Test reservation bases """
reservation = self.res_obj.create(self.data)
self.assertEqual(reservation.partner_id, self.partner)
self.assertEqual(reservation.user_id, self.env.user)
self.assertEqual(reservation.hour_start, 11.0)
self.assertEqual(reservation.hour_stop, 12.0)
self.assertEqual(reservation.state, 'draft')
self.assertFalse(reservation.rejection_reason)
self.assertEqual(reservation.name, 'Resource/2018-02-05')
self.assertEqual(reservation.date_start, '2018-02-05 11:00:00')
self.assertEqual(reservation.date_stop, '2018-02-05 12:00:00')
self.assertEqual(reservation.resource_id, self.resource)
self.assertEqual(len(reservation.resource_timetable_ids), 1)
self.assertEqual(reservation.resource_id.reservation_ids[0], reservation)
def test_reservation_hours(self):
""" Test thats stop hour can not be after or equal start hour """
self.data['hour_stop'] = 7.0
with self.assertRaises(ValidationError):
self.res_obj.create(self.data)
with self.assertRaises(ValidationError):
self.res_obj.create({
'resource_id': self.resource.id, 'date': '2018-02-05',
'hour_start': 12.0, 'hour_stop': 12.0,
'partner_id': self.partner.id
})
def test_state_basic(self):
""" Tests basic state methods """
reservation = self.res_obj.create(self.data)
self.assertEqual(reservation.state, 'draft')
reservation.state_draft()
self.assertEqual(reservation.state, 'draft')
reservation.state_canceled()
self.assertEqual(reservation.state, 'canceled')
reservation.state_validated()
self.assertEqual(reservation.state, 'validated')
reservation.state_draft()
self.assertEqual(reservation.state, 'draft')
reservation.state_confirm() # Here the reservation is OK, pass the checks
self.assertEqual(reservation.state, 'validated')
def test_state_rejected(self):
""" Tests state rejected """
self.data['resource_id'] = self.resource_val.id
reservation = self.res_obj.create(self.data)
self.assertEqual(reservation.state, 'draft')
reservation.state_confirm()
self.assertEqual(reservation.state, 'confirmed')
# We may have called the wizard here
reservation.write({'state': 'rejected', 'rejection_reason': 'Reason'})
self.assertEqual(reservation.state, 'rejected')
self.assertEqual(reservation.rejection_reason, 'Reason')
def test_confirm_access(self):
""" Test that only golem_manager can confirm or reject reservation """
self.data['resource_id'] = self.resource_val.id
reservation = self.res_obj.create(self.data)
self.assertEqual(reservation.state, 'draft')
reservation.state_confirm()
reservation.state_validated() # OK there, as admin is GOLEM Manager
reservation.state_canceled()
reservation.state_draft()
reservation.state_confirm()
# Removes group GOLEM manager from current user
group_manager = self.env.ref('golem_base.group_golem_manager')
self.env.user.groups_id = [(2, group_manager.id, False)]
with self.assertRaises(ValidationError) as err:
reservation.state_validated()
self.assertIn('do not have permissions to validate', err.exception.args[0])
def test_confirmed_period(self):
""" Test allowed period """
self.data['date'] = '2012-01-01' # Out of period
reservation = self.res_obj.create(self.data)
with self.assertRaises(ValidationError) as err:
reservation.state_confirm()
self.assertIn('not available in this period', err.exception.args[0])
def test_confirmed_allowed_day(self):
""" Test allowed day """
self.data['date'] = '2018-02-06' # Bad day
reservation = self.res_obj.create(self.data)
with self.assertRaises(ValidationError) as err:
reservation.state_confirm()
self.assertIn('not available this day', err.exception.args[0])
def test_confirmed_allowed_hours(self):
""" Test allowed hours """
self.data['hour_stop'] = 14.0 # Out of range stop hour
reservation = self.res_obj.create(self.data)
with self.assertRaises(ValidationError) as err:
reservation.state_confirm()
self.assertIn('please choose another time', err.exception.args[0])
reservation = self.res_obj.create({'resource_id': self.resource.id,
'date': '2018-02-05',
'hour_start': 5.0, # Out of range start hour
'hour_stop': 12.0,
'partner_id': self.partner.id})
with self.assertRaises(ValidationError) as err:
reservation.state_confirm()
self.assertIn('please choose another time', err.exception.args[0])
def test_confirmed_other_res(self):
""" Test if there are other reservations in conflict """
reservation = self.res_obj.create(self.data)
reservation.state_confirm()
reservation2 = self.res_obj.create({
'resource_id': self.resource.id, 'date': '2018-02-05',
'hour_start': 10.0, 'hour_stop': 11.0, # OK, no conflict
'partner_id': self.partner.id
})
reservation2.state_confirm()
reservation3 = self.res_obj.create({
'resource_id': self.resource.id, 'date': '2018-02-05',
'hour_start': 10.0, 'hour_stop': 10.5, # Conflict with 2nd res
'partner_id': self.partner.id
})
with self.assertRaises(ValidationError) as err:
reservation3.state_confirm()
self.assertIn('resource is already taken', err.exception.args[0])

View File

@ -0,0 +1,58 @@
# -*- 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 Resource Timetable testing """
from odoo.tests.common import TransactionCase
from odoo.exceptions import ValidationError
class TestGolemResourceTimetable(TransactionCase):
""" GOLEM Resource Timetable testing """
def setUp(self, *args, **kwargs):
""" Bootstrap timetable """
super(TestGolemResourceTimetable, self).setUp(*args, **kwargs)
self.resource = self.env['golem.resource'].create({
'name': 'Resource',
'validation_required': False,
'avaibility_start': '2018-01-01',
'avaibility_stop': '2020-01-01'
})
self.timetable_obj = self.env['golem.resource.timetable']
self.data = {'resource_id': self.resource.id,
'weekday': '0',
'time_start': 8.0,
'time_stop': 10.0}
def test_timetable_basic(self):
""" Test Timetable bases """
timetable = self.timetable_obj.create(self.data)
self.assertEqual(timetable.resource_id, self.resource)
self.assertEqual(timetable.time_start, 8.0)
self.assertEqual(timetable.time_stop, 10.0)
self.assertEqual(timetable, self.resource.timetable_ids[0])
def test_timetable_times(self):
""" Test timetable times : stop can not be equal or after start """
self.data.update({'time_stop': 7.0})
with self.assertRaises(ValidationError):
self.timetable_obj.create(self.data)
self.data.update({'time_stop': self.data['time_start']})
with self.assertRaises(ValidationError):
self.timetable_obj.create(self.data)

View File

@ -0,0 +1,144 @@
<?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>
<!-- Calendars -->
<record model="ir.ui.view" id="golem_resource_reservation_view_calendar">
<field name="name">GOLEM Resource Reservation Calendar</field>
<field name="model">golem.resource.reservation</field>
<field name="arch" type="xml">
<calendar date_start="date_start" date_stop="date_stop" color="resource_id">
<field name="resource_id" />
<field name="user_id" />
<field name="partner_id" />
</calendar>
</field>
</record>
<!-- Trees -->
<record model="ir.ui.view" id="golem_resource_reservation_view_tree">
<field name="name">GOLEM Resource Reservation Tree</field>
<field name="model">golem.resource.reservation</field>
<field name="arch" type="xml">
<tree>
<field name="resource_id" />
<field name="date" />
<field name="hour_start" widget="float_time" />
<field name="hour_stop" widget="float_time" />
<field name="partner_id" />
<field name="state" />
</tree>
</field>
</record>
<!-- Forms -->
<record model="ir.ui.view" id="golem_resource_reservation_view_form">
<field name="name">GOLEM Resource Reservation Form</field>
<field name="model">golem.resource.reservation</field>
<field name="arch" type="xml">
<form>
<header>
<button name="state_confirm" type="object" string="Confirm" class="oe_highlight"
attrs="{'invisible': ['|', ('state', 'not in', 'draft'), ('id', '=', False)]}" />
<button name="state_canceled" type="object"
string="Cancel" states="confirmed,validated" />
<button name="state_draft" type="object" string="Set to draft"
states="canceled,confirmed,validated,rejected" />
<button name="state_validated" type="object" string="Validate"
states="confirmed" class="oe_highlight"
groups="golem_base.group_golem_manager" />
<button name="state_rejected" type="object" string="Reject"
states="confirmed" class="oe_highlight"
groups="golem_base.group_golem_manager" />
<field name="state" widget="statusbar" />
</header>
<sheet>
<group>
<group string="Resource">
<field name="id" invisible="1" />
<field name="resource_id" options="{'no_create': True}" />
<field name="resource_avaibility_start" readonly="1" />
<field name="resource_avaibility_stop" readonly="1" />
<field name="resource_timetable_ids" readonly="1" />
</group>
<group string="Reservation">
<group>
<field name="date" />
<field name="hour_start" widget="float_time" />
<field name="hour_stop" widget="float_time" />
<field name="user_id" options="{'no_create': True}" />
<field name="partner_id" />
<field name="rejection_reason"
attrs="{'invisible': [('state', '!=', 'rejected')]}"/>
</group>
</group>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="message_ids" widget="mail_thread" />
</div>
</form>
</field>
</record>
<!-- Searches -->
<record model="ir.ui.view" id="golem_resource_reservation_view_search">
<field name="name">GOLEM Resource Reservation Search</field>
<field name="model">golem.resource.reservation</field>
<field name="arch" type="xml">
<search>
<field name="date_start" />
<field name="date_stop" />
<field name="resource_id" />
<field name="user_id" />
<field name="partner_id" />
<field name="state" />
<filter name="to_validate" string="Reservation to Validate"
domain="[('state', '=', 'confirmed')]" />
<filter name="group_state" string="State"
context="{'group_by': 'state'}" />
<filter name="group_resource" string="Resource"
context="{'group_by': 'resource_id'}" />
<filter name="group_partner_id" string="Partner"
context="{'group_by': 'partner_id'}" />
<filter name="group_user" string="User"
context="{'group_by': 'user_id'}" />
<filter name="group_date_month" string="Month"
context="{'group_by': 'date:month'}" />
<filter name="group_date_week" string="Week"
context="{'group_by': 'date:week'}" />
<filter name="group_date_day" string="Day"
context="{'group_by': 'date:day'}" />
</search>
</field>
</record>
<!-- Actions -->
<act_window id="golem_resource_reservation_action" name="Reservations"
res_model="golem.resource.reservation" view_mode="tree,form,calendar" />
<!-- Menus -->
<menuitem id="golem_resource_reservation_menu" name="Reservations"
parent="golem_resource_menu" action="golem_resource_reservation_action"
sequence="20" />
</data>
</odoo>

View File

@ -0,0 +1,37 @@
<?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>
<!-- Trees -->
<record model="ir.ui.view" id="golem_resource_timetable_view_tree">
<field name="name">GOLEM Resource Timetable Tree</field>
<field name="model">golem.resource.timetable</field>
<field name="arch" type="xml">
<tree editable="bottom">
<field name="resource_id" invisible="1" />
<field name="weekday" />
<field name="time_start" string="Start hour" widget="float_time" />
<field name="time_stop" string="Stop hour" widget="float_time" />
</tree>
</field>
</record>
</data>
</odoo>

View File

@ -0,0 +1,54 @@
<?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>
<!-- Trees -->
<record model="ir.ui.view" id="golem_resource_type_view_tree">
<field name="name">GOLEM Resource Type Tree</field>
<field name="model">golem.resource.type</field>
<field name="arch" type="xml">
<tree editable="bottom">
<field name="name" />
</tree>
</field>
</record>
<!-- Searches -->
<record model="ir.ui.view" id="golem_resource_type_view_search">
<field name="name">GOLEM Resource Type Search</field>
<field name="model">golem.resource.type</field>
<field name="arch" type="xml">
<search>
<field name="name" />
</search>
</field>
</record>
<!-- Actions -->
<act_window id="golem_resource_type_action" name="Resource Types"
res_model="golem.resource.type" view_mode="tree" />
<!-- Menus -->
<menuitem id="resource_cofiguration_type_menu" name="Resource Types"
parent="resource_configuration_menu"
action="golem_resource_type_action" sequence="10" />
</data>
</odoo>

View File

@ -0,0 +1,130 @@
<?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>
<!-- Trees -->
<record model="ir.ui.view" id="golem_resource_view_tree">
<field name="name">GOLEM Resource Tree</field>
<field name="model">golem.resource</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
<field name="type_id" />
<field name="supervisor_id" />
<field name="product_tmpl_id" />
<field name="avaibility_start" />
<field name="avaibility_stop" />
<field name="validation_required" />
</tree>
</field>
</record>
<!-- Forms -->
<record model="ir.ui.view" id="golem_resource_view_form">
<field name="name">GOLEM Resource Form</field>
<field name="model">golem.resource</field>
<field name="arch" type="xml">
<form>
<sheet>
<div class="oe_button_box" name="button_box">
<button class="oe_stat_button" icon="fa-archive"
name="active_toggle" type="object">
<field name="active" widget="boolean_button"
options="{'terminology': 'archive'}" />
</button>
</div>
<group>
<group>
<field name="name" />
<field name="type_id" />
<field name="product_tmpl_id" options="{'no_create': True}" />
</group>
<group>
<field name="validation_required" />
<field name="supervisor_id" />
</group>
</group>
<group string="Availibility configuration">
<group colspan="2">
<field name="id" invisible="1"/>
<field name="avaibility_start" />
<field name="avaibility_stop" />
</group>
<p attrs="{'invisible': [('id', '!=', False)]}">
Please save the resource before fixing the timetable availibility"
</p>
<group colspan="2">
<field name="timetable_ids"
context="{'default_resource_id': active_id}"
attrs="{'readonly': [('id', '=', False)]}" />
</group>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="message_ids" widget="mail_thread" />
</div>
</form>
</field>
</record>
<!-- Searches -->
<record model="ir.ui.view" id="golem_resource_view_search">
<field name="name">GOLEM Resource search</field>
<field name="model">golem.resource</field>
<field name="arch" type="xml">
<search>
<field name="name" />
<field name="type_id" />
<field name="supervisor_id" />
<field name="product_tmpl_id" />
<filter name="with_validation" string="With validation"
domain="[('validation_required', '=', True)]" />
<filter name="without_validation" string="Without validation"
domain="[('validation_required', '=', False)]" />
<separator />
<filter name="archived" string="Archived"
domain="[('active', '=', False)]" />
<filter name="group_type" string="Type"
context="{'group_by': 'type_id'}"/>
<filter name="group_supervisor" string="Supervisor"
context="{'group_by': 'supervisor_id'}"/>
<filter name="group_product" string="Linked product"
context="{'group_by': 'product_tmpl_id'}"/>
</search>
</field>
</record>
<!-- Actions -->
<act_window id="golem_resource_action" name="Resources"
res_model="golem.resource" view_mode="tree,form" />
<!-- Menus -->
<menuitem id="golem_resource_menu" name="Resources"
sequence="55" groups="golem_base.group_golem_user"
web_icon="golem_resource,static/description/icon.png" />
<menuitem id="resource_list_menu" name="Resources" parent="golem_resource_menu"
action="golem_resource_action" sequence="10" />
<menuitem id="resource_configuration_menu" name="Configuration"
parent="golem_resource_menu" groups="golem_base.group_golem_manager"
sequence="90" />
</data>
</odoo>

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 golem_reservation_rejection

View File

@ -0,0 +1,36 @@
# -*- 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 Resources management """
from odoo import models, fields, api
class GolemReservationRejectionWizard(models.TransientModel):
"""GOLEM Resource wizard : refusal reason for a reservation """
_name = "golem.reservation.rejection.wizard"
reservation_id = fields.Many2one('golem.resource.reservation', required=True)
reason = fields.Text(required=True)
@api.multi
def reject(self):
""" Sets reservation status to rejected and add reason """
self.ensure_one()
rejection = self[0]
rejection.reservation_id.write({'state': 'rejected',
'rejection_reason': rejection.reason})

View File

@ -0,0 +1,42 @@
<?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_reservation_rejection_wizard_view_form">
<field name="name">GOLEM Reservation Rejection Wizard Form</field>
<field name="model">golem.reservation.rejection.wizard</field>
<field name="arch" type="xml">
<form string="Rejection reason">
<group>
<field name="reservation_id" readonly="1" />
<field name="reason" />
</group>
<footer>
<button name="reject" string="Reject" type="object"
class="oe_highlight" />
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
</data>
</odoo>

View File

@ -1,6 +1,6 @@
# -*- 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
# it under the terms of the GNU Affero General Public License as
@ -18,12 +18,18 @@
{
'name': 'GOLEM seasons',
'summary': 'GOLEM non-profit seasons management',
'version': '10.0.1.0.0',
'description': '''GOLEM non-profit seasons management :
- add season with name and period ;
- choose on per default season ;
- link optionnally one or many memberships types''',
'version': '10.0.1.1.1',
'category': 'GOLEM',
'author': 'Fabien Bourgeois',
'license': 'AGPL-3',
'application': False,
'installable': True,
'depends': ['golem_base'],
'data': ['security/ir.model.access.csv', 'views/golem_season_views.xml']
'data': ['security/ir.model.access.csv',
'views/golem_season_views.xml',
'views/membership_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-01-18 14:18+0000\n"
"PO-Revision-Date: 2018-01-18 14:18+0000\n"
"POT-Creation-Date: 2018-03-06 07:14+0000\n"
"PO-Revision-Date: 2018-03-06 07:14+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -31,7 +31,7 @@ msgid "Created on"
msgstr "Créé le"
#. module: golem_season
#: code:addons/golem_season/models/golem_season.py:75
#: code:addons/golem_season/models/golem_season.py:73
#, python-format
msgid "Current period cannot be included into another existing period."
msgstr "La période actuelle est en conflit avec une période existante."
@ -57,7 +57,7 @@ msgid "Display Name"
msgstr "Nom affiché"
#. module: golem_season
#: code:addons/golem_season/models/golem_season.py:71
#: code:addons/golem_season/models/golem_season.py:69
#, python-format
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."
@ -93,15 +93,21 @@ msgstr "Dernière mise à jour par"
msgid "Last Updated on"
msgstr "Dernière mise à jour le"
#. module: golem_season
#: model:ir.model.fields,field_description:golem_season.field_product_product_membership_season_id
#: model:ir.model.fields,field_description:golem_season.field_product_template_membership_season_id
msgid "Linked season"
msgstr "Saison liée"
#. module: golem_season
#: model:ir.ui.view,arch_db:golem_season.golem_season_view_form
msgid "Make this season as default"
msgstr "Activer cette saison par défaut"
#. module: golem_season
#: model:ir.model.fields,field_description:golem_season.field_golem_season_membership_id
msgid "Membership type"
msgstr "Type d'adhésion"
#: model:ir.model.fields,field_description:golem_season.field_golem_season_membership_ids
msgid "Membership types"
msgstr "Types d'adhésion"
#. module: golem_season
#: model:ir.model.fields,field_description:golem_season.field_golem_season_date_end
@ -113,8 +119,14 @@ msgstr "Fin de la période"
msgid "Period start"
msgstr "Début de la période"
#. module: golem_season
#: model:ir.model,name:golem_season.model_product_template
msgid "Product Template"
msgstr "Modèle d'article"
#. module: golem_season
#: model:ir.ui.view,arch_db:golem_season.golem_season_view_form
#: model:ir.ui.view,arch_db:golem_season.membership_product_search_form_view_inherit_golem_season
msgid "Season"
msgstr "Saison"
@ -129,25 +141,25 @@ msgid "Seasons"
msgstr "Saisons"
#. module: golem_season
#: code:addons/golem_season/models/golem_season.py:62
#: code:addons/golem_season/models/golem_season.py:60
#, python-format
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."
#. module: golem_season
#: code:addons/golem_season/models/golem_season.py:67
#: code:addons/golem_season/models/golem_season.py:65
#, python-format
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."
#. module: golem_season
#: code:addons/golem_season/models/golem_season.py:58
#: code:addons/golem_season/models/golem_season.py:56
#, python-format
msgid "The date end is required"
msgstr "The date end is required"
#. module: golem_season
#: code:addons/golem_season/models/golem_season.py:60
#: code:addons/golem_season/models/golem_season.py:58
#, python-format
msgid "The date start is required"
msgstr "The date start is required"
@ -160,8 +172,7 @@ 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."
#. module: golem_season
#: code:addons/golem_season/models/golem_season.py:114
#: code:addons/golem_season/models/golem_season.py:112
#, python-format
msgid "You can't delete the default season"
msgstr "Vous ne pouvez pas supprimer la saison par défaut"

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-01-18 14:18+0000\n"
"PO-Revision-Date: 2018-01-18 14:18+0000\n"
"POT-Creation-Date: 2018-03-06 07:14+0000\n"
"PO-Revision-Date: 2018-03-06 07:14+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -31,7 +31,7 @@ msgid "Created on"
msgstr ""
#. module: golem_season
#: code:addons/golem_season/models/golem_season.py:75
#: code:addons/golem_season/models/golem_season.py:73
#, python-format
msgid "Current period cannot be included into another existing period."
msgstr ""
@ -57,7 +57,7 @@ msgid "Display Name"
msgstr ""
#. module: golem_season
#: code:addons/golem_season/models/golem_season.py:71
#: code:addons/golem_season/models/golem_season.py:69
#, python-format
msgid "End of the period is in range of an existing period."
msgstr ""
@ -93,14 +93,20 @@ msgstr ""
msgid "Last Updated on"
msgstr ""
#. module: golem_season
#: model:ir.model.fields,field_description:golem_season.field_product_product_membership_season_id
#: model:ir.model.fields,field_description:golem_season.field_product_template_membership_season_id
msgid "Linked season"
msgstr ""
#. module: golem_season
#: model:ir.ui.view,arch_db:golem_season.golem_season_view_form
msgid "Make this season as default"
msgstr ""
#. module: golem_season
#: model:ir.model.fields,field_description:golem_season.field_golem_season_membership_id
msgid "Membership type"
#: model:ir.model.fields,field_description:golem_season.field_golem_season_membership_ids
msgid "Membership types"
msgstr ""
#. module: golem_season
@ -113,8 +119,14 @@ msgstr ""
msgid "Period start"
msgstr ""
#. module: golem_season
#: model:ir.model,name:golem_season.model_product_template
msgid "Product Template"
msgstr ""
#. module: golem_season
#: model:ir.ui.view,arch_db:golem_season.golem_season_view_form
#: model:ir.ui.view,arch_db:golem_season.membership_product_search_form_view_inherit_golem_season
msgid "Season"
msgstr ""
@ -129,25 +141,25 @@ msgid "Seasons"
msgstr ""
#. module: golem_season
#: code:addons/golem_season/models/golem_season.py:62
#: code:addons/golem_season/models/golem_season.py:60
#, python-format
msgid "Start of the period cannot be after end of the period."
msgstr ""
#. module: golem_season
#: code:addons/golem_season/models/golem_season.py:67
#: code:addons/golem_season/models/golem_season.py:65
#, python-format
msgid "Start of the period is in range of an existing period."
msgstr ""
#. module: golem_season
#: code:addons/golem_season/models/golem_season.py:58
#: code:addons/golem_season/models/golem_season.py:56
#, python-format
msgid "The date end is required"
msgstr ""
#. module: golem_season
#: code:addons/golem_season/models/golem_season.py:60
#: code:addons/golem_season/models/golem_season.py:58
#, python-format
msgid "The date start is required"
msgstr ""
@ -160,7 +172,7 @@ msgid "This season name has already been used."
msgstr ""
#. module: golem_season
#: code:addons/golem_season/models/golem_season.py:114
#: code:addons/golem_season/models/golem_season.py:112
#, python-format
msgid "You can't delete the default season"
msgstr ""

View File

@ -1,6 +1,6 @@
# -*- 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
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from . import golem_season
from . import product_template, golem_season

View File

@ -1,6 +1,6 @@
# -*- 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
# it under the terms of the GNU Affero General Public License as
@ -28,24 +28,22 @@ class GolemSeason(models.Model):
_('This season name has already been used.'))]
name = fields.Char('Season name', copy=False, required=True)
membership_id = fields.Many2one('product.template', 'Membership type',
domain="[('membership', '=', True)]")
membership_ids = fields.One2many('product.template', 'membership_season_id',
string='Membership types',
domain=[('membership', '=', True)])
member_counter = fields.Integer('Counter for member number generation',
readonly=True, default=1)
date_start = fields.Date('Period start')
date_end = fields.Date('Period end')
@api.onchange('membership_id')
@api.onchange('membership_ids')
def _onchange_season_dates(self):
""" Sets defaults dates according to membership type """
for season in self:
if season.membership_id and not season.date_start:
if season.membership_ids and not season.date_start:
season.update({
'date_start': season.membership_id.membership_date_from,
'date_end': season.membership_id.membership_date_to
'date_start': season.membership_ids[0].membership_date_from,
'date_end': season.membership_ids[0].membership_date_to
})
@api.constrains('date_start', 'date_end')

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/>.
""" Product adaptations """
from odoo import models, fields, api
class ProductTemplate(models.Model):
""" Product Template adaptations """
_inherit = 'product.template'
membership_season_id = fields.Many2one('golem.season', 'Linked season', index=True)
@api.onchange('membership_season_id')
def onchange_season(self):
""" Adapts period to selected season if needed """
for product in self:
if product.membership and product.membership_season_id \
and not product.membership_date_from:
product.update({
'membership_date_from': product.membership_season_id.date_start,
'membership_date_to': product.membership_season_id.date_end
})

View File

@ -65,14 +65,25 @@ class TestGolemSeason(TransactionCase):
'date_start' : False,
'date_end': '2009-11-01'})
def test__onchange_season_dates(self):
def test_membership(self):
""" Test if membership """
membership = self.env['product.template'].create({'name': 'Name',
'membership': True,
'membership_date_from': '2017-11-01',
'membership_date_to': '2018-11-01'})
new_season = self.env['golem.season'].create({'name': 'Name',
'membership_id': membership.id})
self.assertEqual(new_season.membership_id, membership)
new_season = self.env['golem.season'].create({'name': 'Name'})
membership = self.env['product.template'].create({
'name': 'Name',
'season_id': new_season.id,
'membership': True,
'membership_date_from': '2017-11-01',
'membership_date_to': '2018-11-01'
})
self.assertEqual(new_season.membership_ids[0], membership)
self.assertEqual(membership.season_id, new_season)
membership2 = self.env['product.template'].create({
'name': 'Name2',
'membership': True,
'membership_date_from': '2017-11-01',
'membership_date_to': '2018-11-01'
})
new_season.membership_ids = [(4, membership2.id, False)]
self.assertEqual(len(new_season.membership_ids), 2)
self.assertEqual(new_season.membership_ids[1], membership2)
self.assertEqual(membership2.season_id, new_season)

View File

@ -35,8 +35,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</div>
<group string="Season">
<field name="is_default" invisible="True" />
<field name="membership_id" options="{'no_create': true}"/>
<field name="name" attrs="{'required': True}" />
<field name="membership_ids" widget="many2many_tags"
options="{'no_create': True}" />
<field name="date_start"
attrs="{'required': [('date_end', '!=', False)]}" />
<field name="date_end"

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="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/>.
-->
<odoo>
<data>
<!-- Forms -->
<record id="membership_products_view_form_inherit_golem_season"
model="ir.ui.view">
<field name="name">Membership Product Form adaptations</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="membership.membership_products_form" />
<field name="arch" type="xml">
<field name="default_code" position="before">
<field name="membership_season_id" options="{'no_create': True}" />
</field>
</field>
</record>
<!-- Searches -->
<record id="membership_product_search_form_view_inherit_golem_season"
model="ir.ui.view">
<field name="name">Membership Product Search adaptations</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="membership.membership_product_search_form_view" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="membership_season_id" />
</field>
<xpath expr="//group/filter[1]" position="after">
<filter name="group_season" string="Season"
context="{'group_by': 'membership_season_id'}" />
</xpath>
</field>
</record>
</data>
</odoo>