diff --git a/golem_activity/__manifest__.py b/golem_activity/__manifest__.py index ede28ce..cf63b8e 100644 --- a/golem_activity/__manifest__.py +++ b/golem_activity/__manifest__.py @@ -18,9 +18,9 @@ { 'name': 'GOLEM activities', 'summary': 'Extends Odoo products for multi-activity', - 'version': '10.0.2.0.0', + 'version': '10.0.2.1.0', 'category': 'GOLEM', - 'author': 'Fabien Bourgeois', + 'author': 'Fabien Bourgeois, Michel Dessenne', 'license': 'AGPL-3', 'application': True, 'installable': True, diff --git a/golem_activity/i18n/fr.po b/golem_activity/i18n/fr.po index d1b65f0..702d3fe 100644 --- a/golem_activity/i18n/fr.po +++ b/golem_activity/i18n/fr.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-14 06:14+0000\n" -"PO-Revision-Date: 2017-06-14 06:14+0000\n" +"POT-Creation-Date: 2018-02-01 16:28+0000\n" +"PO-Revision-Date: 2018-02-01 16:28+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -78,6 +78,18 @@ msgstr "Nom de l'activité" msgid "Activity Types" msgstr "Types d'activité" +#. module: golem_activity +#: code:addons/golem_activity/models/golem_activity.py:120 +#, python-format +msgid "Activity end date can not be set after linked season end." +msgstr "La date de fin ne peut pas être apprêt la date de fin de la saison." + +#. module: golem_activity +#: code:addons/golem_activity/models/golem_activity.py:116 +#, python-format +msgid "Activity start date can not be set before linked season start." +msgstr "La date de début ne peut pas être avant la date de début de la saison." + #. module: golem_activity #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_type_name msgid "Activity type" @@ -273,7 +285,7 @@ msgid "Expense Account" msgstr "Compte de dépenses" #. module: golem_activity -#: code:addons/golem_activity/models/golem_activity.py:120 +#: code:addons/golem_activity/models/golem_activity.py:138 #: selection:golem.activity,weekday:0 #, python-format msgid "Friday" @@ -350,6 +362,11 @@ msgstr "Numéro d'article international (IAN) utilisé pour identifier cet artic msgid "Invoicing" msgstr "Facturation" +#. module: golem_activity +#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_is_fullseason +msgid "Is full season?" +msgstr "Est sur toute la saison ?" + #. module: golem_activity #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_is_recurrent #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_type_is_recurrent @@ -405,7 +422,7 @@ msgid "Membership Start Date" msgstr "Date de début d'adhésion" #. module: golem_activity -#: code:addons/golem_activity/models/golem_activity.py:116 +#: code:addons/golem_activity/models/golem_activity.py:134 #: selection:golem.activity,weekday:0 #, python-format msgid "Monday" @@ -493,7 +510,7 @@ msgid "Sale Price" msgstr "Prix de vente" #. module: golem_activity -#: code:addons/golem_activity/models/golem_activity.py:121 +#: code:addons/golem_activity/models/golem_activity.py:139 #: selection:golem.activity,weekday:0 #, python-format msgid "Saturday" @@ -540,8 +557,8 @@ msgid "Start date" msgstr "Date de début" #. module: golem_activity -#: code:addons/golem_activity/models/golem_activity.py:103 -#: code:addons/golem_activity/models/golem_activity.py:138 +#: code:addons/golem_activity/models/golem_activity.py:113 +#: code:addons/golem_activity/models/golem_activity.py:156 #, 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 antérieure à sa fin" @@ -557,7 +574,7 @@ msgid "Stop time" msgstr "Heure de fin" #. module: golem_activity -#: code:addons/golem_activity/models/golem_activity.py:122 +#: code:addons/golem_activity/models/golem_activity.py:140 #: selection:golem.activity,weekday:0 #, python-format msgid "Sunday" @@ -601,7 +618,7 @@ msgid "This field holds the image used as image for the activity." msgstr "This field holds the image used as image for the activity." #. module: golem_activity -#: code:addons/golem_activity/models/golem_activity.py:119 +#: code:addons/golem_activity/models/golem_activity.py:137 #: selection:golem.activity,weekday:0 #, python-format msgid "Thursday" @@ -618,14 +635,14 @@ msgid "True" msgstr "True" #. module: golem_activity -#: code:addons/golem_activity/models/golem_activity.py:117 +#: code:addons/golem_activity/models/golem_activity.py:135 #: selection:golem.activity,weekday:0 #, python-format msgid "Tuesday" msgstr "Mardi" #. module: golem_activity -#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_type_id_3959 +#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_type_id_3891 msgid "Type" msgstr "Type" @@ -655,7 +672,7 @@ msgid "Warranty" msgstr "Garantie" #. module: golem_activity -#: code:addons/golem_activity/models/golem_activity.py:118 +#: code:addons/golem_activity/models/golem_activity.py:136 #: selection:golem.activity,weekday:0 #, python-format msgid "Wednesday" @@ -680,4 +697,3 @@ msgstr "Atelier" #: model:ir.ui.view,arch_db:golem_activity.golem_activity_form msgid "describe the activity characteristics..." msgstr "Décrivez ici les caractéristiques de l'activité..." - diff --git a/golem_activity/i18n/golem_activity.pot b/golem_activity/i18n/golem_activity.pot index 0118dfc..3b770b9 100644 --- a/golem_activity/i18n/golem_activity.pot +++ b/golem_activity/i18n/golem_activity.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-14 06:14+0000\n" -"PO-Revision-Date: 2017-06-14 06:14+0000\n" +"POT-Creation-Date: 2018-02-01 16:28+0000\n" +"PO-Revision-Date: 2018-02-01 16:28+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -74,6 +74,18 @@ msgstr "" msgid "Activity Types" msgstr "" +#. module: golem_activity +#: code:addons/golem_activity/models/golem_activity.py:120 +#, python-format +msgid "Activity end date can not be set after linked season start." +msgstr "" + +#. module: golem_activity +#: code:addons/golem_activity/models/golem_activity.py:116 +#, python-format +msgid "Activity start date can not be set before linked season start." +msgstr "" + #. module: golem_activity #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_type_name msgid "Activity type" @@ -269,7 +281,7 @@ msgid "Expense Account" msgstr "" #. module: golem_activity -#: code:addons/golem_activity/models/golem_activity.py:120 +#: code:addons/golem_activity/models/golem_activity.py:138 #: selection:golem.activity,weekday:0 #, python-format msgid "Friday" @@ -346,6 +358,11 @@ msgstr "" msgid "Invoicing" msgstr "" +#. module: golem_activity +#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_is_fullseason +msgid "Is full season?" +msgstr "" + #. module: golem_activity #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_is_recurrent #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_type_is_recurrent @@ -401,7 +418,7 @@ msgid "Membership Start Date" msgstr "" #. module: golem_activity -#: code:addons/golem_activity/models/golem_activity.py:116 +#: code:addons/golem_activity/models/golem_activity.py:134 #: selection:golem.activity,weekday:0 #, python-format msgid "Monday" @@ -489,7 +506,7 @@ msgid "Sale Price" msgstr "" #. module: golem_activity -#: code:addons/golem_activity/models/golem_activity.py:121 +#: code:addons/golem_activity/models/golem_activity.py:139 #: selection:golem.activity,weekday:0 #, python-format msgid "Saturday" @@ -536,8 +553,8 @@ msgid "Start date" msgstr "" #. module: golem_activity -#: code:addons/golem_activity/models/golem_activity.py:103 -#: code:addons/golem_activity/models/golem_activity.py:138 +#: code:addons/golem_activity/models/golem_activity.py:113 +#: code:addons/golem_activity/models/golem_activity.py:156 #, python-format msgid "Start of the period cannot be after end of the period." msgstr "" @@ -553,7 +570,7 @@ msgid "Stop time" msgstr "" #. module: golem_activity -#: code:addons/golem_activity/models/golem_activity.py:122 +#: code:addons/golem_activity/models/golem_activity.py:140 #: selection:golem.activity,weekday:0 #, python-format msgid "Sunday" @@ -597,7 +614,7 @@ msgid "This field holds the image used as image for the activity." msgstr "" #. module: golem_activity -#: code:addons/golem_activity/models/golem_activity.py:119 +#: code:addons/golem_activity/models/golem_activity.py:137 #: selection:golem.activity,weekday:0 #, python-format msgid "Thursday" @@ -614,14 +631,14 @@ msgid "True" msgstr "" #. module: golem_activity -#: code:addons/golem_activity/models/golem_activity.py:117 +#: code:addons/golem_activity/models/golem_activity.py:135 #: selection:golem.activity,weekday:0 #, python-format msgid "Tuesday" msgstr "" #. module: golem_activity -#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_type_id_3959 +#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_type_id_3891 msgid "Type" msgstr "" @@ -651,7 +668,7 @@ msgid "Warranty" msgstr "" #. module: golem_activity -#: code:addons/golem_activity/models/golem_activity.py:118 +#: code:addons/golem_activity/models/golem_activity.py:136 #: selection:golem.activity,weekday:0 #, python-format msgid "Wednesday" diff --git a/golem_activity/models/golem_activity.py b/golem_activity/models/golem_activity.py index 7f0a504..bb25069 100644 --- a/golem_activity/models/golem_activity.py +++ b/golem_activity/models/golem_activity.py @@ -30,6 +30,7 @@ class GolemActivityType(models.Model): name = fields.Char('Activity type', required=True, translate=True) is_recurrent = fields.Boolean('Is recurrent?') + class GolemActivity(models.Model): """ GOLEM Activity """ _name = 'golem.activity' @@ -46,8 +47,17 @@ class GolemActivity(models.Model): full_name = fields.Char('Name', compute='_compute_full_name', store=True, index=True) + is_fullseason = fields.Boolean('Is full season?', + compute='_compute_is_full_season') + + @api.depends('date_start', 'date_stop') + def _compute_is_full_season(self): + """ Display date for is full season """ + for activity in self: + if activity.date_start == activity.season_id.date_start and \ + activity.date_stop == activity.season_id.date_end: + activity.is_fullseason = True - @api.multi @api.depends('name', 'default_code') def _compute_full_name(self): """ Provide a better displayed name """ @@ -102,6 +112,14 @@ class GolemActivity(models.Model): 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: + 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: + msg = _(u'Activity end date can not be set after ' + 'linked season end.') + raise models.ValidationError(msg) @api.onchange('season_id') def _onchange_season_dates(self): diff --git a/golem_activity/views/golem_activity_views.xml b/golem_activity/views/golem_activity_views.xml index 0912382..f961f60 100644 --- a/golem_activity/views/golem_activity_views.xml +++ b/golem_activity/views/golem_activity_views.xml @@ -59,10 +59,15 @@ along with this program. If not, see . attrs="{'invisible': [('is_recurrent', '=', False)]}" /> + + + attrs="{'invisible':[('is_recurrent', '=', True), + ('is_fullseason', '=', True)]}" /> + attrs="{'invisible':[('is_recurrent', '=', True), + ('is_fullseason', '=', True)]}" /> @@ -111,8 +116,7 @@ along with this program. If not, see . - +