[IMP][I18N][MIG]GOLEM Resource end renaming work

This commit is contained in:
Fabien BOURGEOIS 2018-08-03 10:54:28 +02:00
parent 8060d261e3
commit 757089762f
6 changed files with 76 additions and 49 deletions

View File

@ -20,7 +20,7 @@
'name': 'GOLEM non-profit resources', 'name': 'GOLEM non-profit resources',
'summary': 'GOLEM resources management', 'summary': 'GOLEM resources management',
'description': ''' GOLEM resources management ''', 'description': ''' GOLEM resources management ''',
'version': '10.0.1.13.3', 'version': '10.0.1.14.0',
'category': 'GOLEM', 'category': 'GOLEM',
'author': 'Youssef El Ouahby, Fabien Bourgeois', 'author': 'Youssef El Ouahby, Fabien Bourgeois',
'license': 'AGPL-3', 'license': 'AGPL-3',

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-16 14:29+0000\n" "POT-Creation-Date: 2018-08-03 08:52+0000\n"
"PO-Revision-Date: 2018-04-16 14:29+0000\n" "PO-Revision-Date: 2018-08-03 10:53+0200\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -16,9 +16,9 @@ msgstr ""
"Plural-Forms: \n" "Plural-Forms: \n"
#. module: golem_resource #. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_availibility_24_7 #: model:ir.model.fields,field_description:golem_resource.field_golem_resource_availability_24_7
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_resource_avaibility_24_7 #: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_resource_availability_24_7
msgid "24/7 availibility" msgid "24/7 availability"
msgstr "Disponibilité 24h/24 7j/7" msgstr "Disponibilité 24h/24 7j/7"
#. module: golem_resource #. module: golem_resource
@ -42,7 +42,7 @@ msgid "Active"
msgstr "Actif" msgstr "Actif"
#. module: golem_resource #. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_availibility_24 #: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_availability_24
msgid "All day" msgid "All day"
msgstr "Toute la journée" msgstr "Toute la journée"
@ -52,26 +52,21 @@ msgid "Archived"
msgstr "Archivé" msgstr "Archivé"
#. module: golem_resource #. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_form #: model:ir.model.fields,field_description:golem_resource.field_golem_resource_availability_start
msgid "Availibility configuration" #: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_resource_availability_start
msgstr "Configuration des disponibilités" msgid "Availability start date"
#. 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é" msgstr "Début de disponibilité"
#. module: golem_resource #. 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_availability_stop
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_resource_avaibility_stop #: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_resource_availability_stop
msgid "Availibility stop date" msgid "Availability stop date"
msgstr "Fin de disponibilité" msgstr "Fin de disponibilité"
#. module: golem_resource #. 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_reservation_resource_timetable_ids
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_ids #: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_ids
msgid "Availibility timetable" msgid "Availability timetable"
msgstr "Tableau des disponibilités" msgstr "Tableau des disponibilités"
#. module: golem_resource #. module: golem_resource
@ -161,7 +156,7 @@ msgstr "Brouillon"
#. module: golem_resource #. module: golem_resource
#: code:addons/golem_resource/models/golem_resource.py:94 #: code:addons/golem_resource/models/golem_resource.py:94
#, python-format #, python-format
msgid "End availibility should be after than start availibility" msgid "End availability should be after than start availability"
msgstr "La fin de disponibilité ne peut pas être après le début" msgstr "La fin de disponibilité ne peut pas être après le début"
#. module: golem_resource #. module: golem_resource
@ -330,7 +325,7 @@ msgstr "Merci de saisir le motif du refus"
#. module: golem_resource #. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_form #: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_form
msgid "Please save the resource before fixing the timetable availibility\"" msgid "Please save the resource before fixing the timetable availability\""
msgstr "Merci de sauvegarder la ressource avant de pouvoir définir ses disponibilités\"" msgstr "Merci de sauvegarder la ressource avant de pouvoir définir ses disponibilités\""
#. module: golem_resource #. module: golem_resource
@ -426,7 +421,6 @@ msgid "Resource Types"
msgstr "Types de ressource" msgstr "Types de ressource"
#. module: golem_resource #. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_product_product_resource_ids
#: model:ir.model.fields,field_description:golem_resource.field_product_template_resource_ids #: model:ir.model.fields,field_description:golem_resource.field_product_template_resource_ids
msgid "Resource ids" msgid "Resource ids"
msgstr "Ressources" msgstr "Ressources"
@ -579,7 +573,13 @@ msgstr "Sans validation"
msgid "You do not have permissions to validate or reject a reservation." msgid "You do not have permissions to validate or reject a reservation."
msgstr "Vous n'avez pas les autorisations nécessaires pour valider ou refuser une réservation." msgstr "Vous n'avez pas les autorisations nécessaires pour valider ou refuser une réservation."
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_form
msgid "availability configuration"
msgstr "Configuration des disponibilités"
#. module: golem_resource #. module: golem_resource
#: model:ir.model,name:golem_resource.model_golem_reservation_rejection_wizard #: model:ir.model,name:golem_resource.model_golem_reservation_rejection_wizard
msgid "golem.reservation.rejection.wizard" msgid "golem.reservation.rejection.wizard"
msgstr "golem.reservation.rejection.wizard" msgstr "golem.reservation.rejection.wizard"

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-16 14:29+0000\n" "POT-Creation-Date: 2018-08-03 08:52+0000\n"
"PO-Revision-Date: 2018-04-16 14:29+0000\n" "PO-Revision-Date: 2018-08-03 08:52+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -16,9 +16,9 @@ msgstr ""
"Plural-Forms: \n" "Plural-Forms: \n"
#. module: golem_resource #. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_availibility_24_7 #: model:ir.model.fields,field_description:golem_resource.field_golem_resource_availability_24_7
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_resource_avaibility_24_7 #: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_resource_availability_24_7
msgid "24/7 availibility" msgid "24/7 availability"
msgstr "" msgstr ""
#. module: golem_resource #. module: golem_resource
@ -42,7 +42,7 @@ msgid "Active"
msgstr "" msgstr ""
#. module: golem_resource #. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_availibility_24 #: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_availability_24
msgid "All day" msgid "All day"
msgstr "" msgstr ""
@ -52,26 +52,21 @@ msgid "Archived"
msgstr "" msgstr ""
#. module: golem_resource #. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_form #: model:ir.model.fields,field_description:golem_resource.field_golem_resource_availability_start
msgid "Availibility configuration" #: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_resource_availability_start
msgid "Availability start date"
msgstr "" msgstr ""
#. module: golem_resource #. 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_availability_stop
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_resource_avaibility_start #: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_resource_availability_stop
msgid "Availibility start date" msgid "Availability stop 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 "" msgstr ""
#. module: golem_resource #. 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_reservation_resource_timetable_ids
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_ids #: model:ir.model.fields,field_description:golem_resource.field_golem_resource_timetable_ids
msgid "Availibility timetable" msgid "Availability timetable"
msgstr "" msgstr ""
#. module: golem_resource #. module: golem_resource
@ -161,7 +156,7 @@ msgstr ""
#. module: golem_resource #. module: golem_resource
#: code:addons/golem_resource/models/golem_resource.py:94 #: code:addons/golem_resource/models/golem_resource.py:94
#, python-format #, python-format
msgid "End availibility should be after than start availibility" msgid "End availability should be after than start availability"
msgstr "" msgstr ""
#. module: golem_resource #. module: golem_resource
@ -330,7 +325,7 @@ msgstr ""
#. module: golem_resource #. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_form #: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_form
msgid "Please save the resource before fixing the timetable availibility\"" msgid "Please save the resource before fixing the timetable availability\""
msgstr "" msgstr ""
#. module: golem_resource #. module: golem_resource
@ -426,7 +421,6 @@ msgid "Resource Types"
msgstr "" msgstr ""
#. module: golem_resource #. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_product_product_resource_ids
#: model:ir.model.fields,field_description:golem_resource.field_product_template_resource_ids #: model:ir.model.fields,field_description:golem_resource.field_product_template_resource_ids
msgid "Resource ids" msgid "Resource ids"
msgstr "" msgstr ""
@ -579,6 +573,11 @@ msgstr ""
msgid "You do not have permissions to validate or reject a reservation." msgid "You do not have permissions to validate or reject a reservation."
msgstr "" msgstr ""
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_view_form
msgid "availability configuration"
msgstr ""
#. module: golem_resource #. module: golem_resource
#: model:ir.model,name:golem_resource.model_golem_reservation_rejection_wizard #: model:ir.model,name:golem_resource.model_golem_reservation_rejection_wizard
msgid "golem.reservation.rejection.wizard" msgid "golem.reservation.rejection.wizard"

View File

@ -0,0 +1,28 @@
# -*- 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/>.
""" Pre-migration script """
from openupgradelib import openupgrade
@openupgrade.migrate(use_env=False)
def migrate(cursor, version):
""" Keep old columns in database for migration """
cursor.execute('ALTER TABLE golem_resource RENAME COLUMN avaibility_start TO availability_start')
cursor.execute('ALTER TABLE golem_resource RENAME COLUMN avaibility_stop TO availability_stop')
cursor.execute('ALTER TABLE golem_resource RENAME COLUMN availibility_24_7 TO availability_24_7')
cursor.execute('ALTER TABLE golem_resource_timetable RENAME COLUMN availibility_24 TO availability_24')

View File

@ -42,11 +42,11 @@ class GolemResource(models.Model):
'order to sell reservations (work in ' 'order to sell reservations (work in '
'progress)') 'progress)')
availability_start = fields.Date(required=True, string='availability start date') availability_start = fields.Date(required=True, string='Availability start date')
availability_stop = fields.Date(required=True, string='availability stop date') availability_stop = fields.Date(required=True, string='Availability stop date')
availability_24_7 = fields.Boolean(string='24/7 availability') availability_24_7 = fields.Boolean(string='24/7 availability')
timetable_ids = fields.One2many('golem.resource.timetable', 'resource_id', timetable_ids = fields.One2many('golem.resource.timetable', 'resource_id',
string='availability timetable') string='Availability timetable')
reservation_ids = fields.One2many('golem.resource.reservation', 'resource_id', reservation_ids = fields.One2many('golem.resource.reservation', 'resource_id',
string='Reservations') string='Reservations')
reservation_count = fields.Integer(compute='_compute_reservation_count') reservation_count = fields.Integer(compute='_compute_reservation_count')

View File

@ -41,9 +41,9 @@ class TestGolemResourceReservation(TransactionCase):
}) })
self.resource = self.env['golem.resource'].create({ self.resource = self.env['golem.resource'].create({
'name': 'Resource', 'name': 'Resource',
'avaibility_start': '2018-01-01', 'availability_start': '2018-01-01',
'avaibility_stop': '2020-01-01', 'availability_stop': '2020-01-01',
'availibility_24_7': True 'availability_24_7': True
}) })
self.partner = self.env['res.partner'].create({'firstname': 'John', self.partner = self.env['res.partner'].create({'firstname': 'John',