Compare commits

...

15 Commits

Author SHA1 Message Date
michel
a60f41c170 [TMP] Translate FR 2018-02-01 17:40:49 +01:00
michel
e0c25a24e1 [TMP]Update number 2018-02-01 17:27:40 +01:00
michel
7ce13e730f [TMP] Text msg check_period 2018-02-01 17:26:47 +01:00
michel
b7234e5c75 [TMP) Computed for is_fullseason 2018-02-01 17:16:19 +01:00
michel
08476a4e67 [TYPO]readonly 2018-02-01 17:05:10 +01:00
michel
588954ab0b [TMP) add computed for is_fullseason 2018-02-01 17:02:39 +01:00
michel
64115c746c [TMP] Display date in if_recurent 2018-02-01 16:00:42 +01:00
michel
62741ca650 / 2018-02-01 15:38:44 +01:00
michel
fcf151b615 [TMP] Date for is_recurent. 2018-02-01 10:34:02 +01:00
michel
7727e9d51d [TMP] Msg and check activity date start end date stop. 2018-01-30 17:01:56 +01:00
michel
149654fdb6 [TMP]Version update and author. 2018-01-29 23:30:11 +01:00
michel
48e5ae7308 [TMP] msg 2018-01-29 23:06:31 +01:00
michel
85a2bf1214 [TMP] Check the date start ans date end related to season date 2018-01-29 22:57:03 +01:00
michel
8b7b88a889 [TMP] Check the date start ans date end related to season date 2018-01-29 22:56:08 +01:00
michel
a65a2f3249 [TMP] Check the date start ans date end related to season date 2018-01-29 22:55:36 +01:00
5 changed files with 87 additions and 32 deletions

View File

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

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: 2017-06-14 06:14+0000\n" "POT-Creation-Date: 2018-02-01 16:28+0000\n"
"PO-Revision-Date: 2017-06-14 06:14+0000\n" "PO-Revision-Date: 2018-02-01 16:28+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -78,6 +78,18 @@ msgstr "Nom de l'activité"
msgid "Activity Types" msgid "Activity Types"
msgstr "Types d'activité" 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 #. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_type_name #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_type_name
msgid "Activity type" msgid "Activity type"
@ -273,7 +285,7 @@ msgid "Expense Account"
msgstr "Compte de dépenses" msgstr "Compte de dépenses"
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:120 #: code:addons/golem_activity/models/golem_activity.py:138
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Friday" msgid "Friday"
@ -350,6 +362,11 @@ msgstr "Numéro d'article international (IAN) utilisé pour identifier cet artic
msgid "Invoicing" msgid "Invoicing"
msgstr "Facturation" 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 #. 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_is_recurrent
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_type_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" msgstr "Date de début d'adhésion"
#. module: golem_activity #. 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 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Monday" msgid "Monday"
@ -493,7 +510,7 @@ msgid "Sale Price"
msgstr "Prix de vente" msgstr "Prix de vente"
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:121 #: code:addons/golem_activity/models/golem_activity.py:139
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Saturday" msgid "Saturday"
@ -540,8 +557,8 @@ msgid "Start date"
msgstr "Date de début" msgstr "Date de début"
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:103 #: code:addons/golem_activity/models/golem_activity.py:113
#: code:addons/golem_activity/models/golem_activity.py:138 #: code:addons/golem_activity/models/golem_activity.py:156
#, python-format #, python-format
msgid "Start of the period cannot be after end of the period." msgid "Start of the period cannot be after end of the period."
msgstr "Le début de la période ne peut être antérieure à sa fin" msgstr "Le début de la période ne peut être antérieure à sa fin"
@ -557,7 +574,7 @@ msgid "Stop time"
msgstr "Heure de fin" msgstr "Heure de fin"
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:122 #: code:addons/golem_activity/models/golem_activity.py:140
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Sunday" 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." msgstr "This field holds the image used as image for the activity."
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:119 #: code:addons/golem_activity/models/golem_activity.py:137
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Thursday" msgid "Thursday"
@ -618,14 +635,14 @@ msgid "True"
msgstr "True" msgstr "True"
#. module: golem_activity #. 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 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Tuesday" msgid "Tuesday"
msgstr "Mardi" msgstr "Mardi"
#. module: golem_activity #. 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" msgid "Type"
msgstr "Type" msgstr "Type"
@ -655,7 +672,7 @@ msgid "Warranty"
msgstr "Garantie" msgstr "Garantie"
#. module: golem_activity #. 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 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Wednesday" msgid "Wednesday"
@ -680,4 +697,3 @@ msgstr "Atelier"
#: model:ir.ui.view,arch_db:golem_activity.golem_activity_form #: model:ir.ui.view,arch_db:golem_activity.golem_activity_form
msgid "describe the activity characteristics..." msgid "describe the activity characteristics..."
msgstr "Décrivez ici les caractéristiques de l'activité..." msgstr "Décrivez ici les caractéristiques de l'activité..."

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: 2017-06-14 06:14+0000\n" "POT-Creation-Date: 2018-02-01 16:28+0000\n"
"PO-Revision-Date: 2017-06-14 06:14+0000\n" "PO-Revision-Date: 2018-02-01 16:28+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -74,6 +74,18 @@ msgstr ""
msgid "Activity Types" msgid "Activity Types"
msgstr "" 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 #. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_type_name #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_type_name
msgid "Activity type" msgid "Activity type"
@ -269,7 +281,7 @@ msgid "Expense Account"
msgstr "" msgstr ""
#. module: golem_activity #. 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 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Friday" msgid "Friday"
@ -346,6 +358,11 @@ msgstr ""
msgid "Invoicing" msgid "Invoicing"
msgstr "" 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 #. 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_is_recurrent
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_type_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 "" msgstr ""
#. module: golem_activity #. 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 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Monday" msgid "Monday"
@ -489,7 +506,7 @@ msgid "Sale Price"
msgstr "" msgstr ""
#. module: golem_activity #. 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 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Saturday" msgid "Saturday"
@ -536,8 +553,8 @@ msgid "Start date"
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:103 #: code:addons/golem_activity/models/golem_activity.py:113
#: code:addons/golem_activity/models/golem_activity.py:138 #: code:addons/golem_activity/models/golem_activity.py:156
#, python-format #, python-format
msgid "Start of the period cannot be after end of the period." msgid "Start of the period cannot be after end of the period."
msgstr "" msgstr ""
@ -553,7 +570,7 @@ msgid "Stop time"
msgstr "" msgstr ""
#. module: golem_activity #. 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 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Sunday" msgid "Sunday"
@ -597,7 +614,7 @@ msgid "This field holds the image used as image for the activity."
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:119 #: code:addons/golem_activity/models/golem_activity.py:137
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Thursday" msgid "Thursday"
@ -614,14 +631,14 @@ msgid "True"
msgstr "" msgstr ""
#. module: golem_activity #. 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 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Tuesday" msgid "Tuesday"
msgstr "" msgstr ""
#. module: golem_activity #. 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" msgid "Type"
msgstr "" msgstr ""
@ -651,7 +668,7 @@ msgid "Warranty"
msgstr "" msgstr ""
#. module: golem_activity #. 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 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Wednesday" msgid "Wednesday"

View File

@ -30,6 +30,7 @@ class GolemActivityType(models.Model):
name = fields.Char('Activity type', required=True, translate=True) name = fields.Char('Activity type', required=True, translate=True)
is_recurrent = fields.Boolean('Is recurrent?') is_recurrent = fields.Boolean('Is recurrent?')
class GolemActivity(models.Model): class GolemActivity(models.Model):
""" GOLEM Activity """ """ GOLEM Activity """
_name = 'golem.activity' _name = 'golem.activity'
@ -46,8 +47,17 @@ class GolemActivity(models.Model):
full_name = fields.Char('Name', compute='_compute_full_name', store=True, full_name = fields.Char('Name', compute='_compute_full_name', store=True,
index=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') @api.depends('name', 'default_code')
def _compute_full_name(self): def _compute_full_name(self):
""" Provide a better displayed name """ """ Provide a better displayed name """
@ -102,6 +112,14 @@ class GolemActivity(models.Model):
activity.date_start > activity.date_stop: activity.date_start > activity.date_stop:
raise models.ValidationError(_('Start of the period cannot be ' raise models.ValidationError(_('Start of the period cannot be '
'after end of the period.')) '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') @api.onchange('season_id')
def _onchange_season_dates(self): def _onchange_season_dates(self):

View File

@ -59,10 +59,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
attrs="{'invisible': [('is_recurrent', '=', False)]}" /> attrs="{'invisible': [('is_recurrent', '=', False)]}" />
<field name="hour_stop" widget="float_time" <field name="hour_stop" widget="float_time"
attrs="{'invisible': [('is_recurrent', '=', False)]}" /> attrs="{'invisible': [('is_recurrent', '=', False)]}" />
<field name="is_fullseason" readonly="False"
attrs="{'invisible':[('is_recurrent', '=', False)]}" />
<field name="date_start" <field name="date_start"
attrs="{'invisible': [('is_recurrent', '=', True)]}" /> attrs="{'invisible':[('is_recurrent', '=', True),
('is_fullseason', '=', True)]}" />
<field name="date_stop" <field name="date_stop"
attrs="{'invisible': [('is_recurrent', '=', True)]}" /> attrs="{'invisible':[('is_recurrent', '=', True),
('is_fullseason', '=', True)]}" />
</group> </group>
<group name="places"> <group name="places">
</group> </group>
@ -111,8 +116,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="animator_id" /> <field name="animator_id" />
<field name="weekday" string="Day" <field name="weekday" string="Day"
attrs="{'invisible': [('is_recurrent', '=', False)]}" /> attrs="{'invisible': [('is_recurrent', '=', False)]}" />
<field name="date_start" string="Date" <field name="date_start" string="Date" />
attrs="{'invisible': [('is_recurrent', '=', True)]}" />
<field name="list_price" sum="True" /> <field name="list_price" sum="True" />
</tree> </tree>
</field> </field>