[IMP]GOLEM Activity registrations : add group by season + improve member acitvities listing

This commit is contained in:
Fabien Bourgeois 2017-06-07 16:44:32 +02:00
parent c6cc973489
commit 96dce9d261
5 changed files with 58 additions and 30 deletions

View File

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-01 21:16+0000\n"
"PO-Revision-Date: 2017-05-01 21:16+0000\n"
"POT-Creation-Date: 2017-06-07 14:42+0000\n"
"PO-Revision-Date: 2017-06-07 14:42+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -17,7 +17,6 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_member_activity_registration_ids
#: model:ir.ui.view,arch_db:golem_activity_registration.golem_member_form_inherit_golem_activity_registration
msgid "Activities"
msgstr "Activités"
@ -32,6 +31,16 @@ msgstr "Activité"
msgid "Activity registrations"
msgstr "Inscriptions"
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_member_activity_registration_all_ids
msgid "All activities"
msgstr "Toutes les activités"
#. module: golem_activity_registration
#: model:ir.ui.view,arch_db:golem_activity_registration.golem_activity_registration_search
msgid "By season"
msgstr "Par saison"
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_registration_create_uid
msgid "Created by"
@ -42,6 +51,11 @@ msgstr "Créé par"
msgid "Created on"
msgstr "Créé le"
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_member_activity_registration_ids
msgid "Current activities"
msgstr "Activités de la saison affichée par défaut"
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_registration_is_current
msgid "Current season?"
@ -52,11 +66,6 @@ msgstr "Saison en cours?"
msgid "Default season"
msgstr "Saison par défaut"
#. module: golem_activity_registration
#: model:ir.ui.view,arch_db:golem_activity_registration.golem_member_form_inherit_golem_activity_registration
msgid "Default season activities"
msgstr "Activités de la saison affichée par défaut"
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_registration_display_name
msgid "Display Name"
@ -119,7 +128,7 @@ msgid "Members"
msgstr "Adhérents"
#. module: golem_activity_registration
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:36
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:38
#: sql_constraint:golem.activity:0
#, python-format
msgid "Number of places cannot be negative."
@ -151,7 +160,7 @@ msgid "Season"
msgstr "Saison"
#. module: golem_activity_registration
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:67
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:69
#, python-format
msgid "Sorry, there is no more place !"
msgstr "Désolé, il n'y a plus de place disponible !"
@ -162,14 +171,15 @@ msgid "Subscription"
msgstr "Inscription"
#. module: golem_activity_registration
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:95
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:97
#, python-format
msgid "Subscription can not be executed : the targeted member is not on the same season as the activity."
msgstr "L'inscription n'a pas pu être enregistrée : le membre visé n'est pas ahdérant pour la même saison que celle pendant laquelle se déroule l'activité."
#. module: golem_activity_registration
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:87
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:89
#: sql_constraint:golem.activity.registration:0
#, python-format
msgid "This member has already been registered for this activity."
msgstr "Le membre a déjà été inscrit à cette activité."

View File

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-01 21:16+0000\n"
"PO-Revision-Date: 2017-05-01 21:16+0000\n"
"POT-Creation-Date: 2017-06-07 14:41+0000\n"
"PO-Revision-Date: 2017-06-07 14:41+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -16,7 +16,6 @@ msgstr ""
"Plural-Forms: \n"
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_member_activity_registration_ids
#: model:ir.ui.view,arch_db:golem_activity_registration.golem_member_form_inherit_golem_activity_registration
msgid "Activities"
msgstr ""
@ -31,6 +30,16 @@ msgstr ""
msgid "Activity registrations"
msgstr ""
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_member_activity_registration_all_ids
msgid "All activities"
msgstr ""
#. module: golem_activity_registration
#: model:ir.ui.view,arch_db:golem_activity_registration.golem_activity_registration_search
msgid "By season"
msgstr ""
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_registration_create_uid
msgid "Created by"
@ -41,6 +50,11 @@ msgstr ""
msgid "Created on"
msgstr ""
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_member_activity_registration_ids
msgid "Current activities"
msgstr ""
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_registration_is_current
msgid "Current season?"
@ -51,11 +65,6 @@ msgstr ""
msgid "Default season"
msgstr ""
#. module: golem_activity_registration
#: model:ir.ui.view,arch_db:golem_activity_registration.golem_member_form_inherit_golem_activity_registration
msgid "Default season activities"
msgstr ""
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_registration_display_name
msgid "Display Name"
@ -118,7 +127,7 @@ msgid "Members"
msgstr ""
#. module: golem_activity_registration
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:36
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:38
#: sql_constraint:golem.activity:0
#, python-format
msgid "Number of places cannot be negative."
@ -150,7 +159,7 @@ msgid "Season"
msgstr ""
#. module: golem_activity_registration
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:67
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:69
#, python-format
msgid "Sorry, there is no more place !"
msgstr ""
@ -161,13 +170,13 @@ msgid "Subscription"
msgstr ""
#. module: golem_activity_registration
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:95
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:97
#, python-format
msgid "Subscription can not be executed : the targeted member is not on the same season as the activity."
msgstr ""
#. module: golem_activity_registration
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:87
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:89
#: sql_constraint:golem.activity.registration:0
#, python-format
msgid "This member has already been registered for this activity."

View File

@ -24,8 +24,10 @@ class GolemMember(models.Model):
_inherit = 'golem.member'
activity_registration_ids = fields.One2many('golem.activity.registration',
'member_id', 'Activities',
index=True)
'member_id', 'Current activities',
domain=[('is_current', '=', True)])
activity_registration_all_ids = fields.One2many('golem.activity.registration',
'member_id', 'All activities')
class GolemActivity(models.Model):
@ -78,9 +80,9 @@ class GolemActivityRegistration(models.Model):
activity_id = fields.Many2one('golem.activity', required=True, index=True,
string='Activity', ondelete='cascade')
season_id = fields.Many2one(string='Season',
related='activity_id.season_id')
related='activity_id.season_id', store=True)
is_current = fields.Boolean('Current season?',
related='activity_id.is_current')
related='activity_id.is_current', store=True)
_sql_constraints = [
('registration_uniq', 'UNIQUE (member_id, activity_id)',

View File

@ -61,6 +61,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="activity_id" widget="many2one" />
<filter name="season_default" string="Default season"
domain="[('is_current', '=', True)]" />
<filter name="group_season" string="By season"
context="{'group_by': 'season_id'}"/>
</search>
</field>
</record>

View File

@ -27,7 +27,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="arch" type="xml">
<page name="other_page" position="before">
<page name="activities" string="Activities">
<p name="default_season_label">Default season activities</p>
<field name="id" invisible="1" />
<group>
<field name="activity_registration_ids"
@ -37,7 +36,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="activity_id"
domain="[('is_current', '=', True)]" />
<field name="season_id" readonly="1" />
<field name="member_id" readonly="1" />
<field name="member_id" readonly="1" invisible="1" />
</tree>
</field>
<field name="activity_registration_all_ids" readonly="1">
<tree>
<field name="activity_id" />
<field name="season_id" />
</tree>
</field>
</group>