[REF]GOLEM Activity : add o2m animated activities

This commit is contained in:
Fabien BOURGEOIS 2018-11-01 16:18:18 +01:00
parent e68bd4c5b2
commit 9390ad88ce
5 changed files with 57 additions and 91 deletions

View File

@ -19,7 +19,7 @@
'name': 'GOLEM activities', 'name': 'GOLEM activities',
'summary': 'Extends Odoo products for multi-activity', 'summary': 'Extends Odoo products for multi-activity',
'description': 'Extends Odoo products for multi-activity', 'description': 'Extends Odoo products for multi-activity',
'version': '10.0.2.6.1', 'version': '10.0.2.7.0',
'category': 'GOLEM', 'category': 'GOLEM',
'author': 'Fabien Bourgeois, Michel Dessenne', 'author': 'Fabien Bourgeois, Michel Dessenne',
'license': 'AGPL-3', 'license': 'AGPL-3',
@ -29,6 +29,5 @@
'data': ['security/ir.model.access.csv', 'data': ['security/ir.model.access.csv',
'data/golem_activity_data.xml', 'data/golem_activity_data.xml',
'views/golem_activity_views.xml', 'views/golem_activity_views.xml',
'report/golem_activity_report_templates.xml', 'report/golem_activity_report_templates.xml']
'views/res_partner_views.xml']
} }

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-08-09 13:33+0000\n" "POT-Creation-Date: 2018-11-01 15:16+0000\n"
"PO-Revision-Date: 2018-08-09 15:47+0200\n" "PO-Revision-Date: 2018-11-01 16:17+0100\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -173,13 +173,13 @@ msgid "Activity audience"
msgstr "Public" msgstr "Public"
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:160 #: code:addons/golem_activity/models/golem_activity.py:167
#, python-format #, python-format
msgid "Activity end date can not be set after linked season end." 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." msgstr "La date de fin ne peut pas être apprêt la date de fin de la saison."
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:156 #: code:addons/golem_activity/models/golem_activity.py:163
#, python-format #, python-format
msgid "Activity start date can not be set before linked season start." 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." msgstr "La date de début ne peut pas être avant la date de début de la saison."
@ -194,6 +194,12 @@ msgstr "Type d'activité"
msgid "Adults" msgid "Adults"
msgstr "Adultes" msgstr "Adultes"
#. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_res_partner_animator_activity_ids
#: model:ir.model.fields,field_description:golem_activity.field_res_users_animator_activity_ids
msgid "Animated activities"
msgstr "Activités animées"
#. module: golem_activity #. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_animator_id #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_animator_id
msgid "Animator" msgid "Animator"
@ -205,7 +211,7 @@ msgid "Arts martiaux"
msgstr "Arts martiaux" msgstr "Arts martiaux"
#. module: golem_activity #. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_audience_id_4516 #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_audience_id_4022
msgid "Audience" msgid "Audience"
msgstr "Public" msgstr "Public"
@ -392,7 +398,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:178 #: code:addons/golem_activity/models/golem_activity.py:185
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Friday" msgid "Friday"
@ -573,7 +579,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:174 #: code:addons/golem_activity/models/golem_activity.py:181
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Monday" msgid "Monday"
@ -590,6 +596,11 @@ msgstr "Nom"
msgid "Others" msgid "Others"
msgstr "Autres" msgstr "Autres"
#. module: golem_activity
#: model:ir.model,name:golem_activity.model_res_partner
msgid "Partner"
msgstr "Partenaire"
#. module: golem_activity #. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_price #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_price
msgid "Price" msgid "Price"
@ -655,12 +666,6 @@ msgstr "Description achat"
msgid "Purchase Unit of Measure" msgid "Purchase Unit of Measure"
msgstr "Unité de mesure d'achat" msgstr "Unité de mesure d'achat"
#. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_resource_ids
#: model:ir.model.fields,field_description:golem_activity.field_product_product_resource_ids
msgid "Resource ids"
msgstr "Resources"
#. module: golem_activity #. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_description_sale #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_description_sale
msgid "Sale Description" msgid "Sale Description"
@ -672,7 +677,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:179 #: code:addons/golem_activity/models/golem_activity.py:186
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Saturday" msgid "Saturday"
@ -725,8 +730,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:153 #: code:addons/golem_activity/models/golem_activity.py:160
#: code:addons/golem_activity/models/golem_activity.py:205 #: code:addons/golem_activity/models/golem_activity.py:212
#, 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"
@ -742,7 +747,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:180 #: code:addons/golem_activity/models/golem_activity.py:187
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Sunday" msgid "Sunday"
@ -793,7 +798,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:177 #: code:addons/golem_activity/models/golem_activity.py:184
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Thursday" msgid "Thursday"
@ -810,14 +815,14 @@ msgid "True"
msgstr "True" msgstr "True"
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:175 #: code:addons/golem_activity/models/golem_activity.py:182
#: 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_3929 #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_type_id_3987
#: model:ir.ui.view,arch_db:golem_activity.golem_activity_report_template #: model:ir.ui.view,arch_db:golem_activity.golem_activity_report_template
msgid "Type" msgid "Type"
msgstr "Type" msgstr "Type"
@ -854,7 +859,7 @@ msgid "Warranty"
msgstr "Garantie" msgstr "Garantie"
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:176 #: code:addons/golem_activity/models/golem_activity.py:183
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Wednesday" msgid "Wednesday"

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-08-09 13:33+0000\n" "POT-Creation-Date: 2018-11-01 15:16+0000\n"
"PO-Revision-Date: 2018-08-09 13:33+0000\n" "PO-Revision-Date: 2018-11-01 15:16+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -170,13 +170,13 @@ msgid "Activity audience"
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:160 #: code:addons/golem_activity/models/golem_activity.py:167
#, python-format #, python-format
msgid "Activity end date can not be set after linked season end." msgid "Activity end date can not be set after linked season end."
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:156 #: code:addons/golem_activity/models/golem_activity.py:163
#, python-format #, python-format
msgid "Activity start date can not be set before linked season start." msgid "Activity start date can not be set before linked season start."
msgstr "" msgstr ""
@ -191,6 +191,12 @@ msgstr ""
msgid "Adults" msgid "Adults"
msgstr "" msgstr ""
#. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_res_partner_animator_activity_ids
#: model:ir.model.fields,field_description:golem_activity.field_res_users_animator_activity_ids
msgid "Animated activities"
msgstr ""
#. module: golem_activity #. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_animator_id #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_animator_id
msgid "Animator" msgid "Animator"
@ -202,7 +208,7 @@ msgid "Arts martiaux"
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_audience_id_4516 #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_audience_id_4022
msgid "Audience" msgid "Audience"
msgstr "" msgstr ""
@ -389,7 +395,7 @@ msgid "Expense Account"
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:178 #: code:addons/golem_activity/models/golem_activity.py:185
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Friday" msgid "Friday"
@ -570,7 +576,7 @@ msgid "Membership Start Date"
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:174 #: code:addons/golem_activity/models/golem_activity.py:181
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Monday" msgid "Monday"
@ -587,6 +593,11 @@ msgstr ""
msgid "Others" msgid "Others"
msgstr "" msgstr ""
#. module: golem_activity
#: model:ir.model,name:golem_activity.model_res_partner
msgid "Partner"
msgstr ""
#. module: golem_activity #. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_price #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_price
msgid "Price" msgid "Price"
@ -652,12 +663,6 @@ msgstr ""
msgid "Purchase Unit of Measure" msgid "Purchase Unit of Measure"
msgstr "" msgstr ""
#. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_resource_ids
#: model:ir.model.fields,field_description:golem_activity.field_product_product_resource_ids
msgid "Resource ids"
msgstr ""
#. module: golem_activity #. module: golem_activity
#: model:ir.model.fields,field_description:golem_activity.field_golem_activity_description_sale #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_description_sale
msgid "Sale Description" msgid "Sale Description"
@ -669,7 +674,7 @@ msgid "Sale Price"
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:179 #: code:addons/golem_activity/models/golem_activity.py:186
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Saturday" msgid "Saturday"
@ -722,8 +727,8 @@ msgid "Start date"
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:153 #: code:addons/golem_activity/models/golem_activity.py:160
#: code:addons/golem_activity/models/golem_activity.py:205 #: code:addons/golem_activity/models/golem_activity.py:212
#, 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 ""
@ -739,7 +744,7 @@ msgid "Stop time"
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:180 #: code:addons/golem_activity/models/golem_activity.py:187
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Sunday" msgid "Sunday"
@ -790,7 +795,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:177 #: code:addons/golem_activity/models/golem_activity.py:184
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Thursday" msgid "Thursday"
@ -807,14 +812,14 @@ msgid "True"
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:175 #: code:addons/golem_activity/models/golem_activity.py:182
#: 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_3929 #: model:ir.model.fields,field_description:golem_activity.field_golem_activity_type_id_3987
#: model:ir.ui.view,arch_db:golem_activity.golem_activity_report_template #: model:ir.ui.view,arch_db:golem_activity.golem_activity_report_template
msgid "Type" msgid "Type"
msgstr "" msgstr ""
@ -851,7 +856,7 @@ msgid "Warranty"
msgstr "" msgstr ""
#. module: golem_activity #. module: golem_activity
#: code:addons/golem_activity/models/golem_activity.py:176 #: code:addons/golem_activity/models/golem_activity.py:183
#: selection:golem.activity,weekday:0 #: selection:golem.activity,weekday:0
#, python-format #, python-format
msgid "Wednesday" msgid "Wednesday"

View File

@ -136,13 +136,6 @@ class GolemActivity(models.Model):
date_start = fields.Date('Start date', copy=False) date_start = fields.Date('Start date', copy=False)
date_stop = fields.Date('End date', copy=False) date_stop = fields.Date('End date', copy=False)
@api.constrains('animator_id')
def save_activity_id(self):
""" Saving Activity in animator_id """
for activity in self:
activity.animator_id.activity_id = activity
@api.onchange('date_start') @api.onchange('date_start')
def _onchange_date_start(self): def _onchange_date_start(self):
""" Sets end date to start date if no start date """ """ Sets end date to start date if no start date """
@ -233,4 +226,6 @@ class ResPartner(models.Model):
""" GOLEM Member partner adaptations """ """ GOLEM Member partner adaptations """
_inherit = 'res.partner' _inherit = 'res.partner'
activity_id = fields.Many2one('golem.activity', ondelete='set null') animator_activity_ids = fields.One2many('golem.activity', 'animator_id',
string='Animated activities',
auto_join=True)

View File

@ -1,38 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017-2018 Fabien Bourgeois <fabien@yaltik.com>
Copyright 2018 Youssef El Ouahby <youssef@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>
<!-- Searches -->
<record model="ir.ui.view" id="res_partner_search_inherit_golem_activity">
<field name="name">Partner GOLEM Activity improvement</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter" />
<field name="arch" type="xml">
<filter name="filter_my_partners" position="before">
<filter name="filter_is_animator" string="Is Animator"
domain="[('activity_id', '!=', False)]" />
<filter name="by_activity" string="By Activity"
context="{'group_by': 'activity_id'}"/>
</filter>
</field>
</record>
</data>
</odoo>