From 963543161e1630f946d62d08dc166a1692cd7dcc Mon Sep 17 00:00:00 2001 From: Fabien Bourgeois Date: Mon, 11 Jul 2016 20:14:53 +0200 Subject: [PATCH] [FIX]GOLEM Seasons : fix for translations on warnings and for first default season --- golem_season/i18n/fr.po | 30 ++++++++++++++--------------- golem_season/i18n/golem_season.pot | 26 ++++++++++++------------- golem_season/models/golem_season.py | 15 ++++++++------- 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/golem_season/i18n/fr.po b/golem_season/i18n/fr.po index 7a45dd3f..e340937c 100644 --- a/golem_season/i18n/fr.po +++ b/golem_season/i18n/fr.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-07-11 05:22+0000\n" -"PO-Revision-Date: 2016-07-11 05:22+0000\n" +"POT-Creation-Date: 2016-07-11 17:19+0000\n" +"PO-Revision-Date: 2016-07-11 17:19+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -31,6 +31,12 @@ msgstr "Créé par" msgid "Created on" msgstr "Créé le" +#. module: golem_season +#: code:addons/golem_season/models/golem_season.py:53 +#, 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." + #. module: golem_season #: view:golem.season:golem_season.filter msgid "Default season" @@ -52,10 +58,10 @@ msgid "Display Name" msgstr "Nom affiché" #. module: golem_season -#: code:addons/golem_season/models/golem_season.py:50 +#: code:addons/golem_season/models/golem_season.py:49 #, 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 la période existante {}" +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." #. module: golem_season #: model:ir.model,name:golem_season.model_golem_season @@ -103,12 +109,6 @@ msgstr "Fin de la période" msgid "Period start" msgstr "Début de la période" -#. module: golem_season -#: code:addons/golem_season/models/golem_season.py:54 -#, python-format -msgid "Period {} cannot be included into current period" -msgstr "La période {} ne peut être incluse dans la période en cours" - #. module: golem_season #: view:golem.season:golem_season.form msgid "Season" @@ -126,13 +126,13 @@ 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:46 +#: code:addons/golem_season/models/golem_season.py:45 #, 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 la période existante {}" +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:74 +#: code:addons/golem_season/models/golem_season.py:75 #, python-format msgid "You can't delete the default season" msgstr "Vous ne pouvez pas supprimer la saison par défaut" diff --git a/golem_season/i18n/golem_season.pot b/golem_season/i18n/golem_season.pot index 0a064917..06f32844 100644 --- a/golem_season/i18n/golem_season.pot +++ b/golem_season/i18n/golem_season.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-07-11 05:22+0000\n" -"PO-Revision-Date: 2016-07-11 05:22+0000\n" +"POT-Creation-Date: 2016-07-11 17:19+0000\n" +"PO-Revision-Date: 2016-07-11 17:19+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -30,6 +30,12 @@ msgstr "" msgid "Created on" msgstr "" +#. module: golem_season +#: code:addons/golem_season/models/golem_season.py:53 +#, python-format +msgid "Current period cannot be included into another existing period." +msgstr "" + #. module: golem_season #: view:golem.season:golem_season.filter msgid "Default season" @@ -51,9 +57,9 @@ msgid "Display Name" msgstr "" #. module: golem_season -#: code:addons/golem_season/models/golem_season.py:50 +#: code:addons/golem_season/models/golem_season.py:49 #, python-format -msgid "End of the period is in range of an existing period {}" +msgid "End of the period is in range of an existing period." msgstr "" #. module: golem_season @@ -102,12 +108,6 @@ msgstr "" msgid "Period start" msgstr "" -#. module: golem_season -#: code:addons/golem_season/models/golem_season.py:54 -#, python-format -msgid "Period {} cannot be included into current period" -msgstr "" - #. module: golem_season #: view:golem.season:golem_season.form msgid "Season" @@ -125,13 +125,13 @@ msgid "Start of the period cannot be after end of the period." msgstr "" #. module: golem_season -#: code:addons/golem_season/models/golem_season.py:46 +#: code:addons/golem_season/models/golem_season.py:45 #, python-format -msgid "Start of the period is in range of an existing period {}" +msgid "Start of the period is in range of an existing period." msgstr "" #. module: golem_season -#: code:addons/golem_season/models/golem_season.py:74 +#: code:addons/golem_season/models/golem_season.py:75 #, python-format msgid "You can't delete the default season" msgstr "" diff --git a/golem_season/models/golem_season.py b/golem_season/models/golem_season.py index 9cae62e2..474cdab1 100644 --- a/golem_season/models/golem_season.py +++ b/golem_season/models/golem_season.py @@ -42,16 +42,16 @@ class GolemSeason(models.Model): seasons = self.env['golem.season'].search([]) for s in seasons: if s.date_start < season.date_start < s.date_end: - msg = _('Start of the period is in range of an ' - 'existing period {}'.format(s.name)) + msg = _(u'Start of the period is in range of an ' + 'existing period.') raise models.ValidationError(msg) if s.date_start < season.date_end < s.date_end: - msg = _('End of the period is in range of an ' - 'existing period {}'.format(s.name)) + msg = _(u'End of the period is in range of an ' + 'existing period.') raise models.ValidationError(msg) if season.date_start < s.date_start < season.date_end: - msg = _('Period {} cannot be included into current ' - 'period'.format(s.name)) + msg = _(u'Current period cannot be included into ' + 'another existing period.') raise models.ValidationError(msg) is_default = fields.Boolean('Default season for views?', readonly=True) @@ -60,7 +60,8 @@ class GolemSeason(models.Model): def do_default_season(self): """ is_default on and ensure that only one is_default is active """ old_default_season = self.search([('is_default', '=', True)]) - old_default_season.is_default = False + if old_default_season: + old_default_season.is_default = False self.is_default = True all_members = self.env['golem.member'].search([]) all_members._compute_is_current()