[IMP]GOLEM Activities Sessions enhancement with type_of field instead of global categories

This commit is contained in:
Fabien Bourgeois 2016-07-15 23:07:24 +02:00
parent 94d8bd0d0f
commit 3ff2549e7e
5 changed files with 187 additions and 74 deletions

View File

@ -20,23 +20,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<openerp>
<data noupdate="1">
<!-- Base data for activities -->
<record model="product.category" id="golem_product_category_all_activities">
<field name="name">Toutes les activités</field>
</record>
<record model="product.category" id="golem_product_category_activities">
<field name="name">Activités</field>
<field name="parent_id"
eval="ref('golem_activity.golem_product_category_all_activities')" />
</record>
<record model="product.category" id="golem_product_category_workshops">
<field name="name">Ateliers</field>
<record model="product.category" id="golem_product_category_wellbeing">
<field name="name">Bien-Être</field>
<field name="parent_id"
eval="ref('golem_activity.golem_product_category_all_activities')" />
eval="ref('golem_activity.golem_product_category_activities')" />
</record>
<record model="product.category" id="golem_product_category_trainings">
<field name="name">Stages</field>
<record model="product.category" id="golem_product_category_martial">
<field name="name">Arts martiaux</field>
<field name="parent_id"
eval="ref('golem_activity.golem_product_category_all_activities')" />
eval="ref('golem_activity.golem_product_category_activities')" />
</record>
<record model="product.category" id="golem_product_category_music">
<field name="name">Musique</field>
<field name="parent_id"
eval="ref('golem_activity.golem_product_category_activities')" />
</record>
</data>
</openerp>

View File

@ -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 10:07+0000\n"
"PO-Revision-Date: 2016-07-11 10:07+0000\n"
"POT-Creation-Date: 2016-07-15 21:03+0000\n"
"PO-Revision-Date: 2016-07-15 21:03+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -16,10 +16,6 @@ msgstr ""
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#. module: golem_activity_session
#: field:golem.activity.session,sales_count:0
msgid "# Sales"
msgstr "# Ventes"
#. module: golem_activity_session
#: field:golem.activity.session,product_variant_count:0
@ -63,15 +59,14 @@ msgid "Activities sessions"
msgstr "Séances des activités"
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:93
#: view:golem.activity.session:golem_activity_session.searches
#: field:golem.activity.session,activity_id:0
#: selection:golem.activity.session,type_of:0
#, python-format
msgid "Activity"
msgstr "Activité"
#. module: golem_activity_session
#: view:golem.activity.session:golem_activity_session.view_form
msgid "Activity Session"
msgstr "Séance"
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:43
#, python-format
@ -103,15 +98,67 @@ msgstr "Par intervenant"
msgid "By category"
msgstr "Par catégorie"
#. module: golem_activity_session
#: view:golem.activity.session:golem_activity_session.searches
msgid "By type"
msgstr "Par type"
#. module: golem_activity_session
#: view:golem.activity.session:golem_activity_session.searches
msgid "By weekday"
msgstr "Par jour de la semaine"
#. module: golem_activity_session
#: field:golem.activity.session,categ_id:0
msgid "Category"
msgstr "Catégorie"
#: field:golem.activity.session,rental:0
msgid "Can be Rent"
msgstr "Peut être loué"
#. module: golem_activity_session
#: field:golem.activity.session,sale_ok:0
msgid "Can be Sold"
msgstr "Peut être vendu"
#. module: golem_activity_session
#: model:ir.ui.menu,name:golem_activity_session.activity_categ
msgid "Categories"
msgstr "Categories"
#. module: golem_activity_session
#: help:golem.activity.session,membership:0
msgid "Check if the product is eligible for membership."
msgstr "Check if the product is eligible for membership."
#. module: golem_activity_session
#: help:golem.activity.session,uos_coeff:0
msgid "Coefficient to convert default Unit of Measure to Unit of Sale\n"
" uos = uom * coeff"
msgstr "Coefficient to convert default Unit of Measure to Unit of Sale\n"
" uos = uom * coeff"
#. module: golem_activity_session
#: field:golem.activity.session,color:0
msgid "Color Index"
msgstr "Color Index"
#. module: golem_activity_session
#: field:golem.activity.session,company_id:0
msgid "Company"
msgstr "Company"
#. module: golem_activity_session
#: help:golem.activity.session,type:0
msgid "Consumable are product where you don't manage stock, a service is a non-material product provided by a company or an individual."
msgstr "Consumable are product where you don't manage stock, a service is a non-material product provided by a company or an individual."
#. module: golem_activity_session
#: field:golem.activity.session,standard_price:0
msgid "Cost Price"
msgstr "Cost Price"
#. module: golem_activity_session
#: help:golem.activity.session,standard_price:0
msgid "Cost price of the product template used for standard stock valuation in accounting and used as a base price on purchase orders. Expressed in the default unit of measure of the product."
msgstr "Cost price of the product template used for standard stock valuation in accounting and used as a base price on purchase orders. Expressed in the default unit of measure of the product."
#. module: golem_activity_session
#: field:golem.activity.session,create_uid:0
@ -199,7 +246,7 @@ msgid "End date"
msgstr "Date de fin"
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:147
#: code:addons/golem_activity_session/models/golem_activity_session.py:161
#, python-format
msgid "End of the session cannot be after the end of activity date"
msgstr "La fin de la séance ne peut être après la fin de l'activité"
@ -220,7 +267,7 @@ msgid "Followers"
msgstr "Abonnés"
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:155
#: code:addons/golem_activity_session/models/golem_activity_session.py:169
#: selection:golem.activity.session,weekday:0
#, python-format
msgid "Friday"
@ -403,7 +450,7 @@ msgid "Minimum places to maintain the session"
msgstr "Nombre de places minimum pour maintenir la session"
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:151
#: code:addons/golem_activity_session/models/golem_activity_session.py:165
#: selection:golem.activity.session,weekday:0
#, python-format
msgid "Monday"
@ -421,19 +468,13 @@ msgid "Net Weight"
msgstr "Net Weight"
#. module: golem_activity_session
#: view:golem.activity.session:golem_activity_session.view_form
#: field:golem.activity.session,note:0
msgid "Note"
msgstr "Note"
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:215
#: code:addons/golem_activity_session/models/golem_activity_session.py:229
#, python-format
msgid "Number of places cannot be negative."
msgstr "Le nombre de places ne peut pas être négatif"
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:218
#: code:addons/golem_activity_session/models/golem_activity_session.py:232
#, python-format
msgid "Overbooked places cannot be inferior than places"
msgstr "Le nombre de places avec surcharge ne peut être inférieur aux places"
@ -529,7 +570,7 @@ msgid "Sale Price"
msgstr "Prix de vente"
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:156
#: code:addons/golem_activity_session/models/golem_activity_session.py:170
#: selection:golem.activity.session,weekday:0
#, python-format
msgid "Saturday"
@ -577,7 +618,7 @@ msgid "Small-sized image of the product. It is automatically resized as a 64x64p
msgstr "Small-sized image of the product. It is automatically resized as a 64x64px image, with aspect ratio preserved. Use this field anywhere a small image is required."
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:198
#: code:addons/golem_activity_session/models/golem_activity_session.py:212
#, python-format
msgid "Sorry, there is no more place !"
msgstr "Désolé mais il n'y a plus de place disponible !"
@ -598,19 +639,19 @@ msgid "Start date"
msgstr "Date de début"
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:173
#: code:addons/golem_activity_session/models/golem_activity_session.py:187
#, 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"
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:139
#: code:addons/golem_activity_session/models/golem_activity_session.py:153
#, python-format
msgid "Start of the session cannot be after end of the session."
msgstr "Le début de la séance ne peut être après sa fin"
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:143
#: code:addons/golem_activity_session/models/golem_activity_session.py:157
#, python-format
msgid "Start of the session cannot be before the start of activity date"
msgstr "Le début de la séance ne peut être fixé avant le début de l'activité"
@ -631,7 +672,7 @@ msgid "Summary"
msgstr "Résumé"
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:157
#: code:addons/golem_activity_session/models/golem_activity_session.py:171
#: selection:golem.activity.session,weekday:0
#, python-format
msgid "Sunday"
@ -698,19 +739,37 @@ msgid "This is the average delay in days between the purchase order confirmation
msgstr "This is the average delay in days between the purchase order confirmation and the receipts for this product and for the default supplier. It is used by the scheduler to order requests based on reordering delays."
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:154
#: code:addons/golem_activity_session/models/golem_activity_session.py:168
#: selection:golem.activity.session,weekday:0
#, python-format
msgid "Thursday"
msgstr "Jeudi"
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:152
#: code:addons/golem_activity_session/models/golem_activity_session.py:95
#: view:golem.activity.session:golem_activity_session.searches
#: selection:golem.activity.session,type_of:0
#, python-format
msgid "Training"
msgstr "Stage"
#. module: golem_activity_session
#: view:golem.activity.session:golem_activity_session.session_tree
msgid "True"
msgstr "Vrai"
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:166
#: selection:golem.activity.session,weekday:0
#, python-format
msgid "Tuesday"
msgstr "Mardi"
#. module: golem_activity_session
#: field:golem.activity.session,type_of:0
msgid "Type"
msgstr "Type"
#. module: golem_activity_session
#: field:golem.activity.session,uom_id:0
msgid "Unit of Measure"
@ -742,7 +801,7 @@ msgid "Warranty"
msgstr "Garantie"
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:153
#: code:addons/golem_activity_session/models/golem_activity_session.py:167
#: selection:golem.activity.session,weekday:0
#, python-format
msgid "Wednesday"
@ -758,6 +817,14 @@ msgstr "Jour de la semaine"
msgid "Work in progress"
msgstr "Travail en cours"
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:94
#: view:golem.activity.session:golem_activity_session.searches
#: selection:golem.activity.session,type_of:0
#, python-format
msgid "Workshop"
msgstr "Atelier"
#. module: golem_activity_session
#: view:golem.activity.session:golem_activity_session.view_form
msgid "describe the activity characteristics..."

View File

@ -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 10:07+0000\n"
"PO-Revision-Date: 2016-07-11 10:07+0000\n"
"POT-Creation-Date: 2016-07-15 21:03+0000\n"
"PO-Revision-Date: 2016-07-15 21:03+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -15,11 +15,6 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: golem_activity_session
#: field:golem.activity.session,sales_count:0
msgid "# Sales"
msgstr ""
#. module: golem_activity_session
#: field:golem.activity.session,product_variant_count:0
msgid "# of Product Variants"
@ -62,7 +57,11 @@ msgid "Activities sessions"
msgstr ""
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:93
#: view:golem.activity.session:golem_activity_session.searches
#: field:golem.activity.session,activity_id:0
#: selection:golem.activity.session,type_of:0
#, python-format
msgid "Activity"
msgstr ""
@ -97,6 +96,11 @@ msgstr ""
msgid "By category"
msgstr ""
#. module: golem_activity_session
#: view:golem.activity.session:golem_activity_session.searches
msgid "By type"
msgstr ""
#. module: golem_activity_session
#: view:golem.activity.session:golem_activity_session.searches
msgid "By weekday"
@ -239,7 +243,7 @@ msgid "End date"
msgstr ""
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:147
#: code:addons/golem_activity_session/models/golem_activity_session.py:161
#, python-format
msgid "End of the session cannot be after the end of activity date"
msgstr ""
@ -260,7 +264,7 @@ msgid "Followers"
msgstr ""
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:155
#: code:addons/golem_activity_session/models/golem_activity_session.py:169
#: selection:golem.activity.session,weekday:0
#, python-format
msgid "Friday"
@ -443,7 +447,7 @@ msgid "Minimum places to maintain the session"
msgstr ""
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:151
#: code:addons/golem_activity_session/models/golem_activity_session.py:165
#: selection:golem.activity.session,weekday:0
#, python-format
msgid "Monday"
@ -461,19 +465,13 @@ msgid "Net Weight"
msgstr ""
#. module: golem_activity_session
#: view:golem.activity.session:golem_activity_session.view_form
#: field:golem.activity.session,note:0
msgid "Note"
msgstr ""
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:215
#: code:addons/golem_activity_session/models/golem_activity_session.py:229
#, python-format
msgid "Number of places cannot be negative."
msgstr ""
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:218
#: code:addons/golem_activity_session/models/golem_activity_session.py:232
#, python-format
msgid "Overbooked places cannot be inferior than places"
msgstr ""
@ -569,7 +567,7 @@ msgid "Sale Price"
msgstr ""
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:156
#: code:addons/golem_activity_session/models/golem_activity_session.py:170
#: selection:golem.activity.session,weekday:0
#, python-format
msgid "Saturday"
@ -617,7 +615,7 @@ msgid "Small-sized image of the product. It is automatically resized as a 64x64p
msgstr ""
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:198
#: code:addons/golem_activity_session/models/golem_activity_session.py:212
#, python-format
msgid "Sorry, there is no more place !"
msgstr ""
@ -638,19 +636,19 @@ msgid "Start date"
msgstr ""
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:173
#: code:addons/golem_activity_session/models/golem_activity_session.py:187
#, python-format
msgid "Start of the period cannot be after end of the period."
msgstr ""
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:139
#: code:addons/golem_activity_session/models/golem_activity_session.py:153
#, python-format
msgid "Start of the session cannot be after end of the session."
msgstr ""
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:143
#: code:addons/golem_activity_session/models/golem_activity_session.py:157
#, python-format
msgid "Start of the session cannot be before the start of activity date"
msgstr ""
@ -671,7 +669,7 @@ msgid "Summary"
msgstr ""
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:157
#: code:addons/golem_activity_session/models/golem_activity_session.py:171
#: selection:golem.activity.session,weekday:0
#, python-format
msgid "Sunday"
@ -738,19 +736,37 @@ msgid "This is the average delay in days between the purchase order confirmation
msgstr ""
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:154
#: code:addons/golem_activity_session/models/golem_activity_session.py:168
#: selection:golem.activity.session,weekday:0
#, python-format
msgid "Thursday"
msgstr ""
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:152
#: code:addons/golem_activity_session/models/golem_activity_session.py:95
#: view:golem.activity.session:golem_activity_session.searches
#: selection:golem.activity.session,type_of:0
#, python-format
msgid "Training"
msgstr ""
#. module: golem_activity_session
#: view:golem.activity.session:golem_activity_session.session_tree
msgid "True"
msgstr ""
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:166
#: selection:golem.activity.session,weekday:0
#, python-format
msgid "Tuesday"
msgstr ""
#. module: golem_activity_session
#: field:golem.activity.session,type_of:0
msgid "Type"
msgstr ""
#. module: golem_activity_session
#: field:golem.activity.session,uom_id:0
msgid "Unit of Measure"
@ -782,7 +798,7 @@ msgid "Warranty"
msgstr ""
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:153
#: code:addons/golem_activity_session/models/golem_activity_session.py:167
#: selection:golem.activity.session,weekday:0
#, python-format
msgid "Wednesday"
@ -798,6 +814,14 @@ msgstr ""
msgid "Work in progress"
msgstr ""
#. module: golem_activity_session
#: code:addons/golem_activity_session/models/golem_activity_session.py:94
#: view:golem.activity.session:golem_activity_session.searches
#: selection:golem.activity.session,type_of:0
#, python-format
msgid "Workshop"
msgstr ""
#. module: golem_activity_session
#: view:golem.activity.session:golem_activity_session.view_form
msgid "describe the activity characteristics..."

View File

@ -90,6 +90,19 @@ class GolemActivitySession(models.Model):
s.session_name = session_name
member_ids = fields.Many2many('golem.member', string='Members')
type_of = fields.Selection([('activity', _('Activity')),
('workshop', _('Workshop')),
('training', _('Training'))],
default='activity', index=True, string='Type')
@api.onchange('type_of')
def onchange_type_of(self):
for s in self:
if s.type_of != 'activity':
s.is_recurrent = False
else:
s.is_recurrent = True
places_used = fields.Integer('Places used', compute='_compute_places_used')
@api.depends('member_ids')

View File

@ -48,6 +48,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<group>
<field name="activity_id" />
<field name="animator_id" />
<field name="type_of" />
<field name="places" />
<field name="places_min" />
<field name="is_overbooked" />
@ -111,8 +112,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
orange: places_remain &lt;= 4;">
<field name="is_recurrent" invisible="True" />
<field name="season_id" />
<field name="type_of" />
<field name="session_name" />
<field name="animator_id" />
<field name="weekday" string="Day"
attrs="{'invisible': [('is_recurrent', '=', False)]}" />
<field name="date_start" string="Date"
@ -120,7 +121,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="places" invisible="True" />
<field name="places_remain" string="Remain" />
<field name="places_used" invisible="True" />
<field name="places_min" invislbe="True" />
<field name="places_min" invisible="True" />
<field name="list_price" sum="True" />
</tree>
</field>
@ -151,7 +152,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="season_id" widget="many2one" />
<filter name="season_default" string="Default season"
domain="[('is_current', '=', True)]" />
<filter name="type_of_activity" string="Activity"
domain="[('type_of', '=', 'activity')]" />
<filter name="type_of_workshop" string="Workshop"
domain="[('type_of', '=', 'workshop')]" />
<filter name="type_of_training" string="Training"
domain="[('type_of', '=', 'training')]" />
<group string="Group By">
<filter name="group_type_of" string="By type"
context="{'group_by': 'type_of'}" />
<filter name="group_category" string="By category"
context="{'group_by': 'categ_id'}"/>
<filter name="group_weekday" string="By weekday"