[REF][IMP]GOLEM Activity Registrations

* Large refactoring around registration trees (using contexts) ;
* Enhancement on base tree view and form.
This commit is contained in:
Fabien BOURGEOIS 2018-08-01 16:16:02 +02:00
parent 84c8166294
commit 33ded22f1b
19 changed files with 226 additions and 216 deletions

View File

@ -18,7 +18,7 @@
{ {
'name': 'GOLEM Activity Member Registrations', 'name': 'GOLEM Activity Member Registrations',
'summary': 'GOLEM Activities Member Registrations management', 'summary': 'GOLEM Activities Member Registrations management',
'version': '10.0.1.3.5', 'version': '10.0.1.4.0',
'category': 'GOLEM', 'category': 'GOLEM',
'author': 'Fabien Bourgeois, Michel Dessenne', 'author': 'Fabien Bourgeois, Michel Dessenne',
'license': 'AGPL-3', 'license': 'AGPL-3',

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-07-20 16:22+0000\n" "POT-Creation-Date: 2018-08-01 14:09+0000\n"
"PO-Revision-Date: 2018-07-20 18:22+0200\n" "PO-Revision-Date: 2018-08-01 16:12+0200\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -72,7 +72,7 @@ msgid "Animator"
msgstr "Intervenant" msgstr "Intervenant"
#. module: golem_activity_registration #. module: golem_activity_registration
#: model:ir.ui.view,arch_db:golem_activity_registration.golem_member_form_inherit_golem_activity_registration #: model:ir.ui.view,arch_db:golem_activity_registration.golem_activity_registration_tree
msgid "Base price" msgid "Base price"
msgstr "Prix de base" msgstr "Prix de base"
@ -191,11 +191,6 @@ msgstr "Dernière mise à jour par"
msgid "Last Updated on" msgid "Last Updated on"
msgstr "Dernière mise à jour le" msgstr "Dernière mise à jour le"
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_registration_member_id
msgid "Member"
msgstr "Adhérent"
#. module: golem_activity_registration #. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_activity_registration_ids #: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_activity_registration_ids
#: model:ir.ui.view,arch_db:golem_activity_registration.golem_activity_form_inherit_registration #: model:ir.ui.view,arch_db:golem_activity_registration.golem_activity_form_inherit_registration
@ -244,6 +239,11 @@ msgstr "Prix de vente"
msgid "Season" msgid "Season"
msgstr "Saison" msgstr "Saison"
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_registration_member_id
msgid "Service user"
msgstr "Usager"
#. module: golem_activity_registration #. module: golem_activity_registration
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:70 #: code:addons/golem_activity_registration/models/golem_activity_registration.py:70
#, python-format #, python-format
@ -269,7 +269,7 @@ msgid "This member has already been registered for this activity."
msgstr "L'usager a déjà été inscrit à cette activité." msgstr "L'usager a déjà été inscrit à cette activité."
#. module: golem_activity_registration #. module: golem_activity_registration
#: model:ir.ui.view,arch_db:golem_activity_registration.golem_member_form_inherit_golem_activity_registration #: model:ir.ui.view,arch_db:golem_activity_registration.golem_activity_registration_tree
msgid "Total" msgid "Total"
msgstr "Total" msgstr "Total"

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-07-20 16:21+0000\n" "POT-Creation-Date: 2018-08-01 14:09+0000\n"
"PO-Revision-Date: 2018-07-20 16:21+0000\n" "PO-Revision-Date: 2018-08-01 14:09+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -72,7 +72,7 @@ msgid "Animator"
msgstr "" msgstr ""
#. module: golem_activity_registration #. module: golem_activity_registration
#: model:ir.ui.view,arch_db:golem_activity_registration.golem_member_form_inherit_golem_activity_registration #: model:ir.ui.view,arch_db:golem_activity_registration.golem_activity_registration_tree
msgid "Base price" msgid "Base price"
msgstr "" msgstr ""
@ -191,11 +191,6 @@ msgstr ""
msgid "Last Updated on" msgid "Last Updated on"
msgstr "" msgstr ""
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_registration_member_id
msgid "Member"
msgstr ""
#. module: golem_activity_registration #. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_activity_registration_ids #: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_activity_registration_ids
#: model:ir.ui.view,arch_db:golem_activity_registration.golem_activity_form_inherit_registration #: model:ir.ui.view,arch_db:golem_activity_registration.golem_activity_form_inherit_registration
@ -244,6 +239,11 @@ msgstr ""
msgid "Season" msgid "Season"
msgstr "" msgstr ""
#. module: golem_activity_registration
#: model:ir.model.fields,field_description:golem_activity_registration.field_golem_activity_registration_member_id
msgid "Service user"
msgstr ""
#. module: golem_activity_registration #. module: golem_activity_registration
#: code:addons/golem_activity_registration/models/golem_activity_registration.py:70 #: code:addons/golem_activity_registration/models/golem_activity_registration.py:70
#, python-format #, python-format
@ -269,7 +269,7 @@ msgid "This member has already been registered for this activity."
msgstr "" msgstr ""
#. module: golem_activity_registration #. module: golem_activity_registration
#: model:ir.ui.view,arch_db:golem_activity_registration.golem_member_form_inherit_golem_activity_registration #: model:ir.ui.view,arch_db:golem_activity_registration.golem_activity_registration_tree
msgid "Total" msgid "Total"
msgstr "" msgstr ""

View File

@ -77,8 +77,8 @@ class GolemActivityRegistration(models.Model):
_description = 'GOLEM Activity Registration' _description = 'GOLEM Activity Registration'
_rec_name ='activity_id' _rec_name ='activity_id'
member_id = fields.Many2one('golem.member', string='Member', required=True, member_id = fields.Many2one('golem.member', string='Service user',
ondelete='cascade', index=True) required=True, ondelete='cascade', index=True)
activity_id = fields.Many2one('golem.activity', required=True, index=True, activity_id = fields.Many2one('golem.activity', required=True, index=True,
string='Activity', ondelete='cascade') string='Activity', ondelete='cascade')
activity_price = fields.Float(related='activity_id.list_price') activity_price = fields.Float(related='activity_id.list_price')

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2017 Fabien Bourgeois <fabien@yaltik.com> Copyright 2017-2018 Fabien Bourgeois <fabien@yaltik.com>
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU Affero General Public License as published by
@ -25,11 +25,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="model">golem.activity.registration</field> <field name="model">golem.activity.registration</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form> <form>
<header></header>
<sheet> <sheet>
<group string="Subscription"> <group name="subscription" string="Subscription">
<field name="member_id" invisible="1" />
<field name="activity_id" /> <field name="activity_id" />
<field name="season_id" /> <field name="season_id" />
<field name="member_id" />
</group> </group>
</sheet> </sheet>
</form> </form>
@ -42,10 +43,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="name">Activity registration list</field> <field name="name">Activity registration list</field>
<field name="model">golem.activity.registration</field> <field name="model">golem.activity.registration</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree create="true" edit="false" delete="false" editable="top"> <tree create="true" edit="true" delete="false" editable="top">
<field name="season_id" readonly="1" /> <field name="season_id" readonly="1"
<field name="member_id" domain="[('is_default', '=', True)]" /> invisible="not context.get('season_show', 1)" />
<field name="activity_id" domain="[('is_default', '=', True)]" /> <field name="member_id" domain="[('is_default', '=', True)]"
invisible="not context.get('member_show', 1)" />
<field name="activity_id" domain="[('is_default', '=', True)]"
invisible="not context.get('activity_show', 1)" />
<field name="activity_price" string="Base price" sum="Total"
invisible="not context.get('activity_show', 1)" />
</tree> </tree>
</field> </field>
</record> </record>
@ -56,9 +62,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="model">golem.activity.registration</field> <field name="model">golem.activity.registration</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<search> <search>
<field name="season_id" widget="many2one" /> <field name="season_id" />
<field name="member_id" widget="many2one" /> <field name="member_id" />
<field name="activity_id" widget="many2one" /> <field name="activity_id" />
<filter name="season_default" string="Default season" <filter name="season_default" string="Default season"
domain="[('is_default', '=', True)]" /> domain="[('is_default', '=', True)]" />
<filter name="group_season" string="By season" <filter name="group_season" string="By season"
@ -71,7 +77,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<record id="golem_activity_registration_action" model="ir.actions.act_window"> <record id="golem_activity_registration_action" model="ir.actions.act_window">
<field name="name">GOLEM Activity Registration List</field> <field name="name">GOLEM Activity Registration List</field>
<field name="res_model">golem.activity.registration</field> <field name="res_model">golem.activity.registration</field>
<field name="view_mode">tree</field> <field name="view_mode">tree,form</field>
</record> </record>
<!-- Menu --> <!-- Menu -->

View File

@ -34,14 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<group> <group>
<field name="places_remain" readonly="True" /> <field name="places_remain" readonly="True" />
<field name="activity_registration_ids" <field name="activity_registration_ids"
context="{'default_activity_id': active_id}"> context="{'default_activity_id': active_id, 'season_show': 0, 'activity_show': 0}" />
<tree editable="top">
<field name="member_id"
domain="[('season_ids', '=', season_id)]" />
<field name="activity_id" invisible="1" />
<field name="season_id" invisible="1" />
</tree>
</field>
</group> </group>
</page> </page>
</page> </page>

View File

@ -31,22 +31,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<group> <group>
<field name="activity_registration_ids" <field name="activity_registration_ids"
attrs="{'readonly': [('id', '=', False)]}" attrs="{'readonly': [('id', '=', False)]}"
context="{'default_member_id': active_id}"> context="{'default_member_id': active_id, 'member_show': 0}" />
<tree editable="top"> <field name="activity_registration_all_ids" readonly="1"
<field name="activity_id" context="{'member_show': 0}" />
domain="[('is_default', '=', True)]" />
<field name="season_id" readonly="1" />
<field name="member_id" readonly="1" invisible="1" />
<field name="activity_price" string="Base price" sum="Total"
readonly="1" />
</tree>
</field>
<field name="activity_registration_all_ids" readonly="1">
<tree>
<field name="activity_id" />
<field name="season_id" />
</tree>
</field>
</group> </group>
</page> </page>
</page> </page>

View File

@ -19,15 +19,14 @@
'name': 'GOLEM Activity Member Registration Payments', 'name': 'GOLEM Activity Member Registration Payments',
'summary': 'GOLEM Activities Member Registration Payments', 'summary': 'GOLEM Activities Member Registration Payments',
'description': 'GOLEM Activities Member Registration Payments', 'description': 'GOLEM Activities Member Registration Payments',
'version': '10.0.0.1.0', 'version': '10.0.0.2.0',
'category': 'GOLEM', 'category': 'GOLEM',
'author': 'Fabien Bourgeois', 'author': 'Fabien Bourgeois',
'license': 'AGPL-3', 'license': 'AGPL-3',
'application': False, 'application': False,
'installable': True, 'installable': True,
'depends': ['golem_activity_registration_state', 'golem_payment'], 'depends': ['golem_activity_registration_state', 'golem_payment'],
'data': ['views/golem_activity_views.xml', 'data': ['views/golem_member_views.xml',
'views/golem_member_views.xml',
'views/golem_activity_registration_views.xml', 'views/golem_activity_registration_views.xml',
'wizard/golem_activity_registration_invoicing.xml'] 'wizard/golem_activity_registration_invoicing.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-07-31 17:51+0000\n" "POT-Creation-Date: 2018-08-01 14:10+0000\n"
"PO-Revision-Date: 2018-07-31 19:58+0200\n" "PO-Revision-Date: 2018-08-01 16:15+0200\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -39,6 +39,16 @@ msgstr "Activités et tarifs"
msgid "All confirmed registrations had already been invoiced." msgid "All confirmed registrations had already been invoiced."
msgstr "Toutes les inscriptions confirmées ont déjà été facturées." msgstr "Toutes les inscriptions confirmées ont déjà été facturées."
#. module: golem_activity_registration_payment
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_search_inherit_payment
msgid "By invoice state"
msgstr "Par état de facturation"
#. module: golem_activity_registration_payment
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_search_inherit_payment
msgid "Canceled Invoice"
msgstr "Facture Annulée"
#. module: golem_activity_registration_payment #. module: golem_activity_registration_payment
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form #: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form
msgid "Close" msgid "Close"
@ -71,6 +81,11 @@ msgstr "Afficher la facture"
msgid "Display payments" msgid "Display payments"
msgstr "Afficher les paiements" msgstr "Afficher les paiements"
#. module: golem_activity_registration_payment
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_search_inherit_payment
msgid "Draft Invoice"
msgstr "Facture Brouillon"
#. module: golem_activity_registration_payment #. module: golem_activity_registration_payment
#: model:ir.model,name:golem_activity_registration_payment.model_golem_activity_registration #: model:ir.model,name:golem_activity_registration_payment.model_golem_activity_registration
msgid "GOLEM Activity Registration" msgid "GOLEM Activity Registration"
@ -128,6 +143,11 @@ msgstr "Ligne de facturation"
msgid "Invoice pending registrations" msgid "Invoice pending registrations"
msgstr "Inscriptions en attente de facturation" msgstr "Inscriptions en attente de facturation"
#. module: golem_activity_registration_payment
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_state_tree_inherit_payment
msgid "Invoice state"
msgstr "Invoice state"
#. module: golem_activity_registration_payment #. module: golem_activity_registration_payment
#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_line_write_uid #: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_line_write_uid
#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_write_uid #: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_write_uid
@ -140,6 +160,16 @@ msgstr "Dernière mise à jour par"
msgid "Last Updated on" msgid "Last Updated on"
msgstr "Dernière mise à jour le" msgstr "Dernière mise à jour le"
#. module: golem_activity_registration_payment
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_search_inherit_payment
msgid "Opened Invoice"
msgstr "Facture Ouverte"
#. module: golem_activity_registration_payment
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_search_inherit_payment
msgid "Paid Invoice"
msgstr "Facture Payée"
#. module: golem_activity_registration_payment #. module: golem_activity_registration_payment
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form #: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form
msgid "Please confirm activity prices and choose a payment schedule if needed." msgid "Please confirm activity prices and choose a payment schedule if needed."

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-07-31 17:51+0000\n" "POT-Creation-Date: 2018-08-01 14:09+0000\n"
"PO-Revision-Date: 2018-07-31 17:51+0000\n" "PO-Revision-Date: 2018-08-01 14:09+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -35,6 +35,16 @@ msgstr ""
msgid "All confirmed registrations had already been invoiced." msgid "All confirmed registrations had already been invoiced."
msgstr "" msgstr ""
#. module: golem_activity_registration_payment
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_search_inherit_payment
msgid "By invoice state"
msgstr ""
#. module: golem_activity_registration_payment
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_search_inherit_payment
msgid "Canceled Invoice"
msgstr ""
#. module: golem_activity_registration_payment #. module: golem_activity_registration_payment
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form #: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form
msgid "Close" msgid "Close"
@ -67,6 +77,11 @@ msgstr ""
msgid "Display payments" msgid "Display payments"
msgstr "" msgstr ""
#. module: golem_activity_registration_payment
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_search_inherit_payment
msgid "Draft Invoice"
msgstr ""
#. module: golem_activity_registration_payment #. module: golem_activity_registration_payment
#: model:ir.model,name:golem_activity_registration_payment.model_golem_activity_registration #: model:ir.model,name:golem_activity_registration_payment.model_golem_activity_registration
msgid "GOLEM Activity Registration" msgid "GOLEM Activity Registration"
@ -124,6 +139,11 @@ msgstr ""
msgid "Invoice pending registrations" msgid "Invoice pending registrations"
msgstr "" msgstr ""
#. module: golem_activity_registration_payment
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_state_tree_inherit_payment
msgid "Invoice state"
msgstr ""
#. module: golem_activity_registration_payment #. module: golem_activity_registration_payment
#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_line_write_uid #: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_line_write_uid
#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_write_uid #: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_write_uid
@ -136,6 +156,16 @@ msgstr ""
msgid "Last Updated on" msgid "Last Updated on"
msgstr "" msgstr ""
#. module: golem_activity_registration_payment
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_search_inherit_payment
msgid "Opened Invoice"
msgstr ""
#. module: golem_activity_registration_payment
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_search_inherit_payment
msgid "Paid Invoice"
msgstr ""
#. module: golem_activity_registration_payment #. module: golem_activity_registration_payment
#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form #: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form
msgid "Please confirm activity prices and choose a payment schedule if needed." msgid "Please confirm activity prices and choose a payment schedule if needed."

View File

@ -27,4 +27,5 @@ class GolemActivityRegistration(models.Model):
string='Invoice line', string='Invoice line',
ondelete='set null') ondelete='set null')
invoice_id = fields.Many2one(related='invoice_line_id.invoice_id') invoice_id = fields.Many2one(related='invoice_line_id.invoice_id')
invoice_state = fields.Selection(related='invoice_line_id.invoice_id.state') invoice_state = fields.Selection(related='invoice_line_id.invoice_id.state',
store=True)

View File

@ -19,29 +19,44 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<data> <data>
<!-- Tree --> <!-- Tree -->
<record id="golem_activity_registration_tree_inherit_payment" model="ir.ui.view"> <record id="golem_activity_registration_state_tree_inherit_payment" model="ir.ui.view">
<field name="name">Activity Registration Tree adaptations</field> <field name="name">Activity Registration State Tree adaptations</field>
<field name="model">golem.activity.registration</field> <field name="model">golem.activity.registration</field>
<field name="inherit_id" <field name="inherit_id"
ref="golem_activity_registration.golem_activity_registration_tree" /> ref="golem_activity_registration_state.golem_activity_registration_tree_inherit_state" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="activity_id" position="after"> <field name="state" position="after">
<field name="invoice_id" readonly="1" /> <field name="invoice_line_id" invisible="1" />
<field name="invoice_line_id" readonly="1" /> <field name="invoice_state" string="Invoice state" />
</field> </field>
</field> </field>
</record> </record>
<!-- Search --> <!-- Search -->
<record id="golem_activity_registration_search_inherit_payment" model="ir.ui.view"> <record id="golem_activity_registration_search_inherit_payment" model="ir.ui.view">
<field name="name">Activity Registration Search adaptations</field> <field name="name">Activity Registration State Search adaptations</field>
<field name="model">golem.activity.registration</field> <field name="model">golem.activity.registration</field>
<field name="inherit_id" <field name="inherit_id"
ref="golem_activity_registration.golem_activity_registration_search" /> ref="golem_activity_registration_state.golem_activity_registration_search_inherit_state" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="activity_id" position="after"> <field name="activity_id" position="after">
<field name="invoice_id" widget="many2one" /> <field name="invoice_id" />
</field> </field>
<filter name="state_canceled" position="after">
<separator />
<filter name="invoice_state_draft" string="Draft Invoice"
domain="[('invoice_state', '=', 'draft')]" />
<filter name="invoice_state_open" string="Opened Invoice"
domain="[('invoice_state', '=', 'open')]" />
<filter name="invoice_state_paid" string="Paid Invoice"
domain="[('invoice_state', '=', 'paid')]" />
<filter name="invoice_state_cancel" string="Canceled Invoice"
domain="[('invoice_state', '=', 'cancel')]" />
</filter>
<filter name="group_state" position="after">
<filter name="group_invoice_state" string="By invoice state"
context="{'group_by': 'invoice_state'}"/>
</filter>
</field> </field>
</record> </record>

View File

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018 Fabien Bourgeois <fabien@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>
<!-- Form -->
<record id="golem_registration_state_activity_form_inherit_registration_payment"
model="ir.ui.view">
<field name="name">Activity Form adaptations</field>
<field name="model">golem.activity</field>
<field name="inherit_id"
ref="golem_activity_registration_state.golem_activity_form_inherit_registration_state" />
<field name="arch" type="xml">
<xpath expr="//tree/field[@name='season_id']" position="after">
<field name="invoice_id" readonly="1" />
</xpath>
</field>
</record>
</data>
</odoo>

View File

@ -19,7 +19,7 @@
'name': 'GOLEM Activity Session Member Registrations States', 'name': 'GOLEM Activity Session Member Registrations States',
'summary': 'GOLEM Activities Session Member Registration states', 'summary': 'GOLEM Activities Session Member Registration states',
'description': 'GOLEM Activities Session Member Registration states', 'description': 'GOLEM Activities Session Member Registration states',
'version': '10.0.2.0.0', 'version': '10.0.2.1.0',
'category': 'GOLEM', 'category': 'GOLEM',
'author': 'Fabien Bourgeois', 'author': 'Fabien Bourgeois',
'license': 'AGPL-3', 'license': 'AGPL-3',
@ -27,6 +27,5 @@
'installable': True, 'installable': True,
'depends': ['golem_activity_registration', 'golem_payment'], 'depends': ['golem_activity_registration', 'golem_payment'],
'data': ['views/golem_activity_registration_views.xml', 'data': ['views/golem_activity_registration_views.xml',
'views/golem_member_views.xml', 'views/golem_member_views.xml']
'views/golem_activity_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-01 11:37+0000\n" "POT-Creation-Date: 2018-08-01 14:09+0000\n"
"PO-Revision-Date: 2018-08-01 13:43+0200\n" "PO-Revision-Date: 2018-08-01 16:13+0200\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -26,30 +26,34 @@ msgid "Activity id"
msgstr "Activité liée" msgstr "Activité liée"
#. module: golem_activity_registration_state #. module: golem_activity_registration_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_form_inherit_registration_state #: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_registration_tree_inherit_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_member_form_inherit_registration_state
msgid "Are you sure you want to remove this subscription ?" msgid "Are you sure you want to remove this subscription ?"
msgstr "Êtes-vous sûr de vouloir supprimer cette inscription ?" msgstr "Êtes-vous sûr de vouloir supprimer cette inscription ?"
#. module: golem_activity_registration_state #. module: golem_activity_registration_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_form_inherit_registration_state #: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_registration_search_inherit_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_member_form_inherit_registration_state msgid "By state"
msgstr "Par état"
#. module: golem_activity_registration_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_registration_tree_inherit_state
msgid "Cancel" msgid "Cancel"
msgstr "Annuler" msgstr "Annuler"
#. module: golem_activity_registration_state #. module: golem_activity_registration_state
#: selection:golem.activity.registration,state:0 #: selection:golem.activity.registration,state:0
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_registration_search_inherit_state
msgid "Canceled" msgid "Canceled"
msgstr "Annulé" msgstr "Annulé"
#. module: golem_activity_registration_state #. module: golem_activity_registration_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_form_inherit_registration_state #: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_registration_tree_inherit_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_member_form_inherit_registration_state
msgid "Confirm" msgid "Confirm"
msgstr "Confirmer" msgstr "Confirmer"
#. module: golem_activity_registration_state #. module: golem_activity_registration_state
#: selection:golem.activity.registration,state:0 #: selection:golem.activity.registration,state:0
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_registration_search_inherit_state
msgid "Confirmed" msgid "Confirmed"
msgstr "Confirmé" msgstr "Confirmé"
@ -61,6 +65,7 @@ msgstr "Nom affiché"
#. module: golem_activity_registration_state #. module: golem_activity_registration_state
#: selection:golem.activity.registration,state:0 #: selection:golem.activity.registration,state:0
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_registration_search_inherit_state
msgid "Draft" msgid "Draft"
msgstr "Brouillon" msgstr "Brouillon"
@ -156,14 +161,12 @@ msgid "Registration id"
msgstr "Registration id" msgstr "Registration id"
#. module: golem_activity_registration_state #. module: golem_activity_registration_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_form_inherit_registration_state #: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_registration_tree_inherit_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_member_form_inherit_registration_state
msgid "Remove" msgid "Remove"
msgstr "Supprimer" msgstr "Supprimer"
#. module: golem_activity_registration_state #. module: golem_activity_registration_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_form_inherit_registration_state #: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_registration_tree_inherit_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_member_form_inherit_registration_state
msgid "Reset to draft" msgid "Reset to draft"
msgstr "Remettre en brouillon" msgstr "Remettre en brouillon"
@ -184,8 +187,8 @@ msgid "Validate all draft registrations"
msgstr "Valider toutes les inscriptions" msgstr "Valider toutes les inscriptions"
#. module: golem_activity_registration_state #. module: golem_activity_registration_state
#: code:addons/golem_activity_registration_state/models/golem_activity_registration.py:101 #: code:addons/golem_activity_registration_state/models/golem_activity_registration.py:79
#: code:addons/golem_activity_registration_state/models/golem_activity_registration.py:114 #: code:addons/golem_activity_registration_state/models/golem_activity_registration.py:92
#, python-format #, python-format
msgid "You can not confirm a canceled registration." msgid "You can not confirm a canceled registration."
msgstr "Vous ne pouvez pas confirmer une inscription qui a été annulée." msgstr "Vous ne pouvez pas confirmer une inscription qui a été annulée."

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-01 11:37+0000\n" "POT-Creation-Date: 2018-08-01 14:09+0000\n"
"PO-Revision-Date: 2018-08-01 11:37+0000\n" "PO-Revision-Date: 2018-08-01 14:09+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -26,30 +26,34 @@ msgid "Activity id"
msgstr "" msgstr ""
#. module: golem_activity_registration_state #. module: golem_activity_registration_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_form_inherit_registration_state #: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_registration_tree_inherit_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_member_form_inherit_registration_state
msgid "Are you sure you want to remove this subscription ?" msgid "Are you sure you want to remove this subscription ?"
msgstr "" msgstr ""
#. module: golem_activity_registration_state #. module: golem_activity_registration_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_form_inherit_registration_state #: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_registration_search_inherit_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_member_form_inherit_registration_state msgid "By state"
msgstr ""
#. module: golem_activity_registration_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_registration_tree_inherit_state
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
#. module: golem_activity_registration_state #. module: golem_activity_registration_state
#: selection:golem.activity.registration,state:0 #: selection:golem.activity.registration,state:0
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_registration_search_inherit_state
msgid "Canceled" msgid "Canceled"
msgstr "" msgstr ""
#. module: golem_activity_registration_state #. module: golem_activity_registration_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_form_inherit_registration_state #: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_registration_tree_inherit_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_member_form_inherit_registration_state
msgid "Confirm" msgid "Confirm"
msgstr "" msgstr ""
#. module: golem_activity_registration_state #. module: golem_activity_registration_state
#: selection:golem.activity.registration,state:0 #: selection:golem.activity.registration,state:0
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_registration_search_inherit_state
msgid "Confirmed" msgid "Confirmed"
msgstr "" msgstr ""
@ -61,6 +65,7 @@ msgstr ""
#. module: golem_activity_registration_state #. module: golem_activity_registration_state
#: selection:golem.activity.registration,state:0 #: selection:golem.activity.registration,state:0
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_registration_search_inherit_state
msgid "Draft" msgid "Draft"
msgstr "" msgstr ""
@ -156,14 +161,12 @@ msgid "Registration id"
msgstr "" msgstr ""
#. module: golem_activity_registration_state #. module: golem_activity_registration_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_form_inherit_registration_state #: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_registration_tree_inherit_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_member_form_inherit_registration_state
msgid "Remove" msgid "Remove"
msgstr "" msgstr ""
#. module: golem_activity_registration_state #. module: golem_activity_registration_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_form_inherit_registration_state #: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_activity_registration_tree_inherit_state
#: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_member_form_inherit_registration_state
msgid "Reset to draft" msgid "Reset to draft"
msgstr "" msgstr ""
@ -184,8 +187,8 @@ msgid "Validate all draft registrations"
msgstr "" msgstr ""
#. module: golem_activity_registration_state #. module: golem_activity_registration_state
#: code:addons/golem_activity_registration_state/models/golem_activity_registration.py:101 #: code:addons/golem_activity_registration_state/models/golem_activity_registration.py:79
#: code:addons/golem_activity_registration_state/models/golem_activity_registration.py:114 #: code:addons/golem_activity_registration_state/models/golem_activity_registration.py:92
#, python-format #, python-format
msgid "You can not confirm a canceled registration." msgid "You can not confirm a canceled registration."
msgstr "" msgstr ""

View File

@ -18,6 +18,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<odoo> <odoo>
<data> <data>
<!-- Form -->
<record id="golem_activity_registration_form_inherit_state"
model="ir.ui.view">
<field name="name">Activity Registration form adaptations</field>
<field name="model">golem.activity.registration</field>
<field name="inherit_id"
ref="golem_activity_registration.golem_activity_registration_form" />
<field name="arch" type="xml">
<header position="inside">
<field name="state" widget="statusbar" readonly="1" />
</header>
</field>
</record>
<!-- Tree --> <!-- Tree -->
<record id="golem_activity_registration_tree_inherit_state" <record id="golem_activity_registration_tree_inherit_state"
model="ir.ui.view"> model="ir.ui.view">
@ -27,13 +41,50 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
ref="golem_activity_registration.golem_activity_registration_tree" /> ref="golem_activity_registration.golem_activity_registration_tree" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree position="attributes"> <tree position="attributes">
<attribute name="colors">red: state == 'canceled';darkgrey: state == 'draft';</attribute> <attribute name="colors">darkgrey: state == 'canceled';blue: state == 'confirmed';</attribute>
<attribute name="delete">0</attribute>
</tree> </tree>
<tree position="inside"> <tree position="inside">
<field name="state" invisible="1" /> <field name="state" readonly="1" />
<button type="object" name="state_draft" string="Reset to draft"
icon="fa-arrow-up" attrs="{'invisible': [('state', '=', 'draft')]}"
invisible="not context.get('action_show', 1)" />
<button type="object" name="state_confirm" string="Confirm"
icon="fa-check" attrs="{'invisible': [('state', '!=', 'draft')]}"
invisible="not context.get('action_show', 1)" />
<button type="object" name="state_cancel" string="Cancel"
icon="fa-ban" attrs="{'invisible': [('state', '=', 'canceled')]}"
invisible="not context.get('action_show', 1)" />
<button type="object" name="state_remove" string="Remove"
icon="fa-trash"
confirm="Are you sure you want to remove this subscription ?"
attrs="{'invisible': [('state', '!=', 'canceled')]}"
invisible="not context.get('action_show', 1)" />
</tree> </tree>
</field> </field>
</record> </record>
<!-- Search -->
<record id="golem_activity_registration_search_inherit_state"
model="ir.ui.view">
<field name="name">Activity Registration search adaptations</field>
<field name="model">golem.activity.registration</field>
<field name="inherit_id"
ref="golem_activity_registration.golem_activity_registration_search" />
<field name="arch" type="xml">
<filter name="season_default" position="after">
<separator />
<filter name="state_draft" string="Draft"
domain="[('state', '=', 'draft')]" />
<filter name="state_confirmed" string="Confirmed"
domain="[('state', '=', 'confirmed')]" />
<filter name="state_canceled" string="Canceled"
domain="[('state', '=', 'canceled')]" />
<filter name="group_state" string="By state"
context="{'group_by': 'state'}"/>
</filter>
</field>
</record>
</data> </data>
</odoo> </odoo>

View File

@ -1,50 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017-2018 Fabien Bourgeois <fabien@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>
<!-- Form -->
<record id="golem_activity_form_inherit_registration_state"
model="ir.ui.view">
<field name="name">Activity Registrations States</field>
<field name="model">golem.activity</field>
<field name="inherit_id"
ref="golem_activity_registration.golem_activity_form_inherit_registration" />
<field name="arch" type="xml">
<tree position="attributes">
<attribute name="colors">darkgrey: state == 'canceled';blue: state == 'confirmed';</attribute>
<attribute name="delete">0</attribute>
</tree>
<tree position="inside">
<field name="state" />
<button type="object" name="state_draft" string="Reset to draft"
icon="fa-arrow-up" attrs="{'invisible': [('state', '=', 'draft')]}" />
<button type="object" name="state_confirm" string="Confirm"
icon="fa-check" attrs="{'invisible': [('state', '!=', 'draft')]}" />
<button type="object" name="state_cancel" string="Cancel"
icon="fa-ban" attrs="{'invisible': [('state', '=', 'canceled')]}" />
<button type="object" name="state_remove" string="Remove"
icon="fa-trash"
confirm="Are you sure you want to remove this subscription ?"
attrs="{'invisible': [('state', '!=', 'canceled')]}" />
</tree>
</field>
</record>
</data>
</odoo>

View File

@ -39,29 +39,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
attrs="{'invisible': [('has_draft_registrations', '=', False)]}" /> attrs="{'invisible': [('has_draft_registrations', '=', False)]}" />
</p> </p>
</field> </field>
<xpath expr="//field[@name='activity_registration_ids']/tree" position="attributes"> <field name="activity_registration_all_ids" position="attributes">
<attribute name="colors">darkgrey: state == 'canceled';blue: state == 'confirmed';</attribute> <attribute name="context">{'member_show': 0, 'action_show': 0}</attribute>
<attribute name="delete">0</attribute> </field>
</xpath>
<xpath expr="//field[@name='activity_registration_ids']/tree" position="inside">
<field name="state" />
<button type="object" name="state_draft" string="Reset to draft"
icon="fa-arrow-up" attrs="{'invisible': [('state', '=', 'draft')]}" />
<button type="object" name="state_confirm" string="Confirm"
icon="fa-check" attrs="{'invisible': [('state', '!=', 'draft')]}" />
<button type="object" name="state_cancel" string="Cancel"
icon="fa-ban" attrs="{'invisible': [('state', '=', 'canceled')]}" />
<button type="object" name="state_remove" string="Remove"
icon="fa-trash"
confirm="Are you sure you want to remove this subscription ?"
attrs="{'invisible': [('state', '!=', 'canceled')]}" />
</xpath>
<xpath expr="//field[@name='activity_registration_all_ids']/tree" position="attributes">
<attribute name="colors">darkgrey: state == 'canceled';blue: state == 'confirmed';</attribute>
</xpath>
<xpath expr="//field[@name='activity_registration_all_ids']/tree" position="inside">
<field name="state" />
</xpath>
</field> </field>
</record> </record>