diff --git a/golem_activity_registration_payment/__init__.py b/golem_activity_registration_payment/__init__.py new file mode 100644 index 0000000..5ca1747 --- /dev/null +++ b/golem_activity_registration_payment/__init__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Fabien Bourgeois +# +# 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 . + +from . import models, wizard diff --git a/golem_activity_registration_payment/__manifest__.py b/golem_activity_registration_payment/__manifest__.py new file mode 100644 index 0000000..f51f23b --- /dev/null +++ b/golem_activity_registration_payment/__manifest__.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Fabien Bourgeois +# +# 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 . + +{ + 'name': 'GOLEM Activity Member Registration Payments', + 'summary': 'GOLEM Activities Member Registration Payments', + 'description': 'GOLEM Activities Member Registration Payments', + 'version': '10.0.0.1.0', + 'category': 'GOLEM', + 'author': 'Fabien Bourgeois', + 'license': 'AGPL-3', + 'application': False, + 'installable': True, + 'depends': ['golem_activity_registration_state', 'golem_payment'], + 'data': ['views/golem_activity_views.xml', + 'views/golem_member_views.xml', + 'views/golem_activity_registration_views.xml', + 'wizard/golem_activity_registration_invoicing.xml'] +} diff --git a/golem_activity_registration_payment/i18n/fr.po b/golem_activity_registration_payment/i18n/fr.po new file mode 100644 index 0000000..8651b2c --- /dev/null +++ b/golem_activity_registration_payment/i18n/fr.po @@ -0,0 +1,181 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * golem_activity_registration_payment +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-07-31 17:51+0000\n" +"PO-Revision-Date: 2018-07-31 19:58+0200\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: golem_activity_registration_payment +#: model:ir.model.fields,help:golem_activity_registration_payment.field_golem_activity_registration_invoice_state +msgid " * The 'Draft' status is used when a user is encoding a new and unconfirmed Invoice.\n" +" * The 'Pro-forma' status is used when the invoice does not have an invoice number.\n" +" * The 'Open' status is used when user creates invoice, an invoice number is generated. It stays in the open status till the user pays the invoice.\n" +" * The 'Paid' status is set automatically when the invoice is paid. Its related journal entries may or may not be reconciled.\n" +" * The 'Cancelled' status is used when user cancel invoice." +msgstr "* L'état \"Brouillon\" est utilisé lorsqu'un utilisateur est en train de saisir ou de modifier une nouvelle facture non confirmée.\n" +"* L'état \"Pro-forma\" est utilisé lorsque la facture n'a pas de numéro de facture.\n" +"* L'état 'Ouvert' est utilisé lorsque l'utilisateur crée une facture, celle-ci a alors un numéro de facture. La facture reste dans l'état \"Ouvert\" tant qu'elle n'est pas payée.\n" +"* L'état 'Payé' est affecté automatiquement lorsque la facture est payée. Les écritures correspondantes dans les journaux peuvent ou non être lettrées.\n" +"* L'état \"Annulé\" est utilisé lorsque l'utilisateur annule la facture." + +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form +msgid "Activities and Prices" +msgstr "Activités et tarifs" + +#. module: golem_activity_registration_payment +#: code:addons/golem_activity_registration_payment/models/golem_member.py:65 +#, python-format +msgid "All confirmed registrations had already been invoiced." +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_invoicing_view_form +msgid "Close" +msgstr "Fermer" + +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form +msgid "Congratulations, activities had been confirmed and invoiced." +msgstr "Félicitations, les activités ont été confirmées et facturées." + +#. module: golem_activity_registration_payment +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_create_uid +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_line_create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: golem_activity_registration_payment +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_create_date +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_line_create_date +msgid "Created on" +msgstr "Créé le" + +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form +msgid "Display invoice" +msgstr "Afficher la facture" + +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form +msgid "Display payments" +msgstr "Afficher les paiements" + +#. module: golem_activity_registration_payment +#: model:ir.model,name:golem_activity_registration_payment.model_golem_activity_registration +msgid "GOLEM Activity Registration" +msgstr "Inscription à l'activité" + +#. module: golem_activity_registration_payment +#: model:ir.model,name:golem_activity_registration_payment.model_golem_activity_registration_invoicing_line +msgid "GOLEM Activity Registration Invoicing Lines" +msgstr "GOLEM Activity Registration Invoicing Lines" + +#. module: golem_activity_registration_payment +#: model:ir.model,name:golem_activity_registration_payment.model_golem_activity_registration_invoicing +msgid "GOLEM Activity Registration Invoicing Wizard" +msgstr "GOLEM Activity Registration Invoicing Wizard" + +#. module: golem_activity_registration_payment +#: model:ir.model,name:golem_activity_registration_payment.model_golem_member +msgid "GOLEM Member" +msgstr "Adhérent" + +#. module: golem_activity_registration_payment +#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:147 +#, python-format +msgid "Generated invoice" +msgstr "Facture générée" + +#. module: golem_activity_registration_payment +#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:162 +#, python-format +msgid "Generated payments" +msgstr "Paiements générés" + +#. module: golem_activity_registration_payment +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_member_has_invoicable_registrations +msgid "Has invoicable registrations ?" +msgstr "A des inscriptions à facturer ?" + +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_registration_state_member_form_inherit_registration_payment +msgid "If you confirmed registrations not already invoiced, you'll get a wizard to assist you for invoice creation." +msgstr "Si vous lancez la facturation des inscriptions en attente, un assistant vous proposera de créer une facture." + +#. module: golem_activity_registration_payment +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoice_id +msgid "Invoice Reference" +msgstr "Référence de la facture" + +#. module: golem_activity_registration_payment +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoice_line_id +msgid "Invoice line" +msgstr "Ligne de facturation" + +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_registration_state_member_form_inherit_registration_payment +msgid "Invoice pending registrations" +msgstr "Inscriptions en attente de facturation" + +#. 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_write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: golem_activity_registration_payment +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_line_write_date +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_write_date +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: golem_activity_registration_payment +#: 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." +msgstr "Merci de confirmer les coûts des activités et de choisir, si souhaité, un échéancier de paiement." + +#. module: golem_activity_registration_payment +#: code:addons/golem_activity_registration_payment/models/golem_member.py:58 +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form +#, python-format +msgid "Registration invoicing" +msgstr "Facturation des inscriptions" + +#. module: golem_activity_registration_payment +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoice_state +msgid "Status" +msgstr "État" + +#. module: golem_activity_registration_payment +#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:143 +#, python-format +msgid "There is no generated invoice." +msgstr "Il n'y a pas de facture générée." + +#. module: golem_activity_registration_payment +#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:158 +#, python-format +msgid "There is no generated payments." +msgstr "Il n'y a pas de paiement généré." + +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form +msgid "Total" +msgstr "Total" + +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form +msgid "Validate" +msgstr "Valider" + diff --git a/golem_activity_registration_payment/i18n/golem_activity_registration_payment.pot b/golem_activity_registration_payment/i18n/golem_activity_registration_payment.pot new file mode 100644 index 0000000..5522147 --- /dev/null +++ b/golem_activity_registration_payment/i18n/golem_activity_registration_payment.pot @@ -0,0 +1,177 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * golem_activity_registration_payment +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-07-31 17:51+0000\n" +"PO-Revision-Date: 2018-07-31 17:51+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: golem_activity_registration_payment +#: model:ir.model.fields,help:golem_activity_registration_payment.field_golem_activity_registration_invoice_state +msgid " * The 'Draft' status is used when a user is encoding a new and unconfirmed Invoice.\n" +" * The 'Pro-forma' status is used when the invoice does not have an invoice number.\n" +" * The 'Open' status is used when user creates invoice, an invoice number is generated. It stays in the open status till the user pays the invoice.\n" +" * The 'Paid' status is set automatically when the invoice is paid. Its related journal entries may or may not be reconciled.\n" +" * The 'Cancelled' status is used when user cancel invoice." +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form +msgid "Activities and Prices" +msgstr "" + +#. module: golem_activity_registration_payment +#: code:addons/golem_activity_registration_payment/models/golem_member.py:65 +#, python-format +msgid "All confirmed registrations had already been invoiced." +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form +msgid "Close" +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form +msgid "Congratulations, activities had been confirmed and invoiced." +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_create_uid +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_line_create_uid +msgid "Created by" +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_create_date +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_line_create_date +msgid "Created on" +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form +msgid "Display invoice" +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form +msgid "Display payments" +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.model,name:golem_activity_registration_payment.model_golem_activity_registration +msgid "GOLEM Activity Registration" +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.model,name:golem_activity_registration_payment.model_golem_activity_registration_invoicing_line +msgid "GOLEM Activity Registration Invoicing Lines" +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.model,name:golem_activity_registration_payment.model_golem_activity_registration_invoicing +msgid "GOLEM Activity Registration Invoicing Wizard" +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.model,name:golem_activity_registration_payment.model_golem_member +msgid "GOLEM Member" +msgstr "" + +#. module: golem_activity_registration_payment +#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:147 +#, python-format +msgid "Generated invoice" +msgstr "" + +#. module: golem_activity_registration_payment +#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:162 +#, python-format +msgid "Generated payments" +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_member_has_invoicable_registrations +msgid "Has invoicable registrations ?" +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_registration_state_member_form_inherit_registration_payment +msgid "If you confirmed registrations not already invoiced, you'll get a wizard to assist you for invoice creation." +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoice_id +msgid "Invoice Reference" +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoice_line_id +msgid "Invoice line" +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_registration_state_member_form_inherit_registration_payment +msgid "Invoice pending registrations" +msgstr "" + +#. 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_write_uid +msgid "Last Updated by" +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_line_write_date +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoicing_write_date +msgid "Last Updated on" +msgstr "" + +#. module: golem_activity_registration_payment +#: 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." +msgstr "" + +#. module: golem_activity_registration_payment +#: code:addons/golem_activity_registration_payment/models/golem_member.py:58 +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form +#, python-format +msgid "Registration invoicing" +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoice_state +msgid "Status" +msgstr "" + +#. module: golem_activity_registration_payment +#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:143 +#, python-format +msgid "There is no generated invoice." +msgstr "" + +#. module: golem_activity_registration_payment +#: code:addons/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py:158 +#, python-format +msgid "There is no generated payments." +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form +msgid "Total" +msgstr "" + +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form +msgid "Validate" +msgstr "" + diff --git a/golem_activity_registration_payment/models/__init__.py b/golem_activity_registration_payment/models/__init__.py new file mode 100644 index 0000000..461a002 --- /dev/null +++ b/golem_activity_registration_payment/models/__init__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Fabien Bourgeois +# +# 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 . + +from . import golem_member, golem_activity_registration diff --git a/golem_activity_registration_payment/models/golem_activity_registration.py b/golem_activity_registration_payment/models/golem_activity_registration.py new file mode 100644 index 0000000..ed33522 --- /dev/null +++ b/golem_activity_registration_payment/models/golem_activity_registration.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Fabien Bourgeois +# +# 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 . + +""" GOLEM Activity Registration adaptations """ + +from odoo import models, fields + +class GolemActivityRegistration(models.Model): + """ GOLEM Activity Registration adaptations """ + _inherit = 'golem.activity.registration' + + invoice_line_id = fields.Many2one('account.invoice.line', + string='Invoice line', + ondelete='set null') + invoice_id = fields.Many2one(related='invoice_line_id.invoice_id') + invoice_state = fields.Selection(related='invoice_line_id.invoice_id.state') diff --git a/golem_activity_registration_payment/models/golem_member.py b/golem_activity_registration_payment/models/golem_member.py new file mode 100644 index 0000000..388beeb --- /dev/null +++ b/golem_activity_registration_payment/models/golem_member.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Fabien Bourgeois +# +# 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 . + +""" GOLEM Member adaptations """ + +from odoo import models, fields, api, _ +from odoo.exceptions import UserError + +class GolemMember(models.Model): + """ GOLEM Member adaptations """ + _inherit = 'golem.member' + + has_invoicable_registrations = fields.Boolean( + 'Has invoicable registrations ?', + compute='_compute_has_invoicable_reg') + + @api.depends('activity_registration_ids', 'activity_registration_ids.state') + def _compute_has_invoicable_reg(self): + """ Check if there are confirmed registrations with no invoice linked """ + for member in self: + regis = member.activity_registration_ids + regis = regis.filtered(lambda r: r.state == 'confirmed' and not r.invoice_line_id) + member.has_invoicable_registrations = bool(len(regis)) + + @api.multi + def invoice_registrations(self): + """ Launch wizard to generate invoices for registrations """ + self.ensure_one() + member = self[0] + registrations = member.activity_registration_ids.filtered( + lambda r: r.state == 'confirmed' and not r.invoice_line_id + ) + if registrations: + invoicing = self.env['golem.activity.registration.invoicing'].create({ + 'member_id' : member.id, + 'season_id': registrations[0].activity_id.season_id.id + }) + line_obj = self.env['golem.activity.registration.invoicing.line'] + for reg in registrations: + line_obj.create({'invoicing_id': invoicing.id, + 'registration_id': reg.id, + 'activity_id': reg.activity_id.id, + 'price': reg.activity_id.list_price}) + return {'name': _('Registration invoicing'), + 'type': 'ir.actions.act_window', + 'res_model': 'golem.activity.registration.invoicing', + 'view_mode': 'form', + 'res_id': invoicing.id, + 'target': 'new'} + else: + uerr = _('All confirmed registrations had already been invoiced.') + raise UserError(uerr) diff --git a/golem_activity_registration_payment/views/golem_activity_registration_views.xml b/golem_activity_registration_payment/views/golem_activity_registration_views.xml new file mode 100644 index 0000000..a8e353b --- /dev/null +++ b/golem_activity_registration_payment/views/golem_activity_registration_views.xml @@ -0,0 +1,49 @@ + + + + + + + + Activity Registration Tree adaptations + golem.activity.registration + + + + + + + + + + + + Activity Registration Search adaptations + golem.activity.registration + + + + + + + + + + diff --git a/golem_activity_registration_payment/views/golem_activity_views.xml b/golem_activity_registration_payment/views/golem_activity_views.xml new file mode 100644 index 0000000..a04f96c --- /dev/null +++ b/golem_activity_registration_payment/views/golem_activity_views.xml @@ -0,0 +1,37 @@ + + + + + + + + + Activity Form adaptations + golem.activity + + + + + + + + + + diff --git a/golem_activity_registration_payment/views/golem_member_views.xml b/golem_activity_registration_payment/views/golem_member_views.xml new file mode 100644 index 0000000..f045f3b --- /dev/null +++ b/golem_activity_registration_payment/views/golem_member_views.xml @@ -0,0 +1,42 @@ + + + + + + + + + Member Form adaptations + golem.member + + + + + + + + diff --git a/golem_activity_registration_state/wizard/__init__.py b/golem_activity_registration_payment/wizard/__init__.py similarity index 100% rename from golem_activity_registration_state/wizard/__init__.py rename to golem_activity_registration_payment/wizard/__init__.py diff --git a/golem_activity_registration_state/wizard/golem_activity_registration_invoicing.py b/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py similarity index 89% rename from golem_activity_registration_state/wizard/golem_activity_registration_invoicing.py rename to golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py index fe530ae..48185ba 100644 --- a/golem_activity_registration_state/wizard/golem_activity_registration_invoicing.py +++ b/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py @@ -1,19 +1,19 @@ # -*- coding: utf-8 -*- -# copyright 2017 fabien bourgeois +# Copyright 2017-2018 Fabien Bourgeois # -# 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 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. +# 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 . +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . """ GOLEM Activity Registration Invoicing Wizard """ @@ -26,7 +26,7 @@ _LOGGER = logging.getLogger(__name__) class GolemActivityRegistrationInvoicingLine(models.TransientModel): """ GOLEM Activity Registration Invoicing Lines """ _name = 'golem.activity.registration.invoicing.line' - description = 'GOLEM Activity Registration Invoicing Lines' + _description = 'GOLEM Activity Registration Invoicing Lines' invoicing_id = fields.Many2one('golem.activity.registration.invoicing', required=True) diff --git a/golem_activity_registration_state/wizard/golem_activity_registration_invoicing.xml b/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.xml similarity index 96% rename from golem_activity_registration_state/wizard/golem_activity_registration_invoicing.xml rename to golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.xml index 39d74e2..26fdba1 100644 --- a/golem_activity_registration_state/wizard/golem_activity_registration_invoicing.xml +++ b/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.xml @@ -21,7 +21,7 @@ along with this program. If not, see . - + GOLEM Activity Registration Invoicing Form golem.activity.registration.invoicing diff --git a/golem_activity_registration_state/__init__.py b/golem_activity_registration_state/__init__.py index 30c0720..25f14d6 100644 --- a/golem_activity_registration_state/__init__.py +++ b/golem_activity_registration_state/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2017 Fabien Bourgeois +# Copyright 2017-2018 Fabien Bourgeois # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -15,4 +15,4 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from . import models, wizard +from . import models diff --git a/golem_activity_registration_state/__manifest__.py b/golem_activity_registration_state/__manifest__.py index bec7a11..5dbeaf7 100644 --- a/golem_activity_registration_state/__manifest__.py +++ b/golem_activity_registration_state/__manifest__.py @@ -19,7 +19,7 @@ 'name': 'GOLEM Activity Session Member Registrations States', 'summary': 'GOLEM Activities Session Member Registration states', 'description': 'GOLEM Activities Session Member Registration states', - 'version': '10.0.1.2.0', + 'version': '10.0.2.0.0', 'category': 'GOLEM', 'author': 'Fabien Bourgeois', 'license': 'AGPL-3', @@ -27,7 +27,6 @@ 'installable': True, 'depends': ['golem_activity_registration', 'golem_payment'], 'data': ['views/golem_activity_registration_views.xml', - 'views/golem_member_views.xml', 'views/golem_activity_views.xml', - 'wizard/golem_activity_registration_invoicing.xml'] - # 'report/golem_member_report.xml'] + 'views/golem_member_views.xml', + 'views/golem_activity_views.xml'] } diff --git a/golem_activity_registration_state/i18n/fr.po b/golem_activity_registration_state/i18n/fr.po index 4e8f761..b17d1d8 100644 --- a/golem_activity_registration_state/i18n/fr.po +++ b/golem_activity_registration_state/i18n/fr.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-20 16:23+0000\n" -"PO-Revision-Date: 2018-07-20 18:24+0200\n" +"POT-Creation-Date: 2018-07-31 17:51+0000\n" +"PO-Revision-Date: 2018-07-31 17:51+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -20,11 +20,6 @@ msgstr "" msgid "Activities" msgstr "Activités" -#. module: golem_activity_registration_state -#: model:ir.ui.view,arch_db:golem_activity_registration_state.invoicing_form -msgid "Activities and Prices" -msgstr "Activities and Prices" - #. module: golem_activity_registration_state #: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_line_activity_id msgid "Activity id" @@ -35,49 +30,17 @@ msgstr "Activité liée" msgid "Canceled" msgstr "Annulé" -#. module: golem_activity_registration_state -#: model:ir.ui.view,arch_db:golem_activity_registration_state.invoicing_form -msgid "Close" -msgstr "Fermer" - #. module: golem_activity_registration_state #: selection:golem.activity.registration,state:0 msgid "Confirmed" msgstr "Confirmé" -#. module: golem_activity_registration_state -#: model:ir.ui.view,arch_db:golem_activity_registration_state.invoicing_form -msgid "Congratulations, activities had been confirmed and invoiced." -msgstr "Félicitations, les activités ont été confirmées et facturées." - -#. module: golem_activity_registration_state -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_create_uid -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_line_create_uid -msgid "Created by" -msgstr "Créé par" - -#. module: golem_activity_registration_state -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_create_date -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_line_create_date -msgid "Created on" -msgstr "Créé le" - #. module: golem_activity_registration_state #: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_display_name #: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_line_display_name msgid "Display Name" msgstr "Nom affiché" -#. module: golem_activity_registration_state -#: model:ir.ui.view,arch_db:golem_activity_registration_state.invoicing_form -msgid "Display invoice" -msgstr "Afficher la facture" - -#. module: golem_activity_registration_state -#: model:ir.ui.view,arch_db:golem_activity_registration_state.invoicing_form -msgid "Display payments" -msgstr "Afficher les paiements" - #. module: golem_activity_registration_state #: selection:golem.activity.registration,state:0 msgid "Draft" @@ -93,6 +56,11 @@ msgstr "Activité" msgid "GOLEM Activity Registration" msgstr "Inscription à l'activité" +#. module: golem_activity_registration_state +#: model:ir.model,name:golem_activity_registration_state.model_golem_activity_registration_invoicing_line +msgid "GOLEM Activity Registration Invoicing Lines" +msgstr "GOLEM Activity Registration Invoicing Lines" + #. module: golem_activity_registration_state #: model:ir.model,name:golem_activity_registration_state.model_golem_activity_registration_invoicing msgid "GOLEM Activity Registration Invoicing Wizard" @@ -104,16 +72,12 @@ msgid "GOLEM Member" msgstr "Adhérent" #. module: golem_activity_registration_state -#: code:addons/golem_activity_registration_state/wizard/golem_activity_registration_invoicing.py:147 #: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_invoice_id -#, python-format msgid "Generated invoice" msgstr "Facture générée" #. module: golem_activity_registration_state -#: code:addons/golem_activity_registration_state/wizard/golem_activity_registration_invoicing.py:162 #: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_payment_ids -#, python-format msgid "Generated payments" msgstr "Paiements générés" @@ -122,12 +86,6 @@ msgstr "Paiements générés" msgid "Has draft registrations ?" msgstr "A des inscriptions non validées ?" -#. module: golem_activity_registration_state -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_id -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_line_id -msgid "ID" -msgstr "ID" - #. module: golem_activity_registration_state #: model:ir.model.fields,help:golem_activity_registration_state.field_golem_activity_registration_invoicing_schedule_id msgid "If no schedule is selected, only the invoice will be create. Otherwise, draft payments will be generated." @@ -135,18 +93,8 @@ msgstr "Si aucun échéancier n'est sélectionné, seule la facture sera créée #. module: golem_activity_registration_state #: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_member_form_inherit_registration_state -msgid "If you validate draft registration, they will be seen as confirmed. Then, an invoice will be created for the current member." -msgstr "Si vous validez les inscriptions, elles seront vues comme confirmées. Ensuite, une facture sera créée pour l'adhérent." - -#. module: golem_activity_registration_state -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoice_id -msgid "Invoice Reference" -msgstr "Référence de la facture" - -#. module: golem_activity_registration_state -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoice_line_id -msgid "Invoice line" -msgstr "Ligne de facturation" +msgid "If you validate draft registrations, they will be seen as confirmed." +msgstr "If you validate draft registrations, they will be seen as confirmed." #. module: golem_activity_registration_state #: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_line_invoicing_id @@ -164,18 +112,6 @@ msgstr "Journal" msgid "Last Modified on" msgstr "Dernière Modification le" -#. module: golem_activity_registration_state -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_line_write_uid -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_write_uid -msgid "Last Updated by" -msgstr "Dernière mise à jour par" - -#. module: golem_activity_registration_state -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_line_write_date -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_write_date -msgid "Last Updated on" -msgstr "Dernière mise à jour le" - #. module: golem_activity_registration_state #: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_member_id msgid "Member" @@ -191,11 +127,6 @@ msgstr "Notez que vous ne devez d'abord enregistrer la fiche d'un nouvel adhére msgid "Payment schedule" msgstr "Échéancier de paiement" -#. module: golem_activity_registration_state -#: model:ir.ui.view,arch_db:golem_activity_registration_state.invoicing_form -msgid "Please confirm activity prices and choose a payment schedule if needed." -msgstr "Merci de confirmer les coûts des activités et de choisir, si souhaité, un échéancier de paiement." - #. module: golem_activity_registration_state #: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_line_price msgid "Price" @@ -206,13 +137,6 @@ msgstr "Prix" msgid "Registration id" msgstr "Registration id" -#. module: golem_activity_registration_state -#: code:addons/golem_activity_registration_state/models/golem_activity_registration.py:58 -#: model:ir.ui.view,arch_db:golem_activity_registration_state.invoicing_form -#, python-format -msgid "Registration invoicing" -msgstr "Registration invoicing" - #. module: golem_activity_registration_state #: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_season_id msgid "Season" @@ -224,28 +148,6 @@ msgstr "Saison" msgid "State" msgstr "État" -#. module: golem_activity_registration_state -#: code:addons/golem_activity_registration_state/wizard/golem_activity_registration_invoicing.py:143 -#, python-format -msgid "There is no generated invoice." -msgstr "Il n'y a pas de facture générée." - -#. module: golem_activity_registration_state -#: code:addons/golem_activity_registration_state/wizard/golem_activity_registration_invoicing.py:158 -#, python-format -msgid "There is no generated payments." -msgstr "Il n'y a pas de paiement généré." - -#. module: golem_activity_registration_state -#: model:ir.ui.view,arch_db:golem_activity_registration_state.invoicing_form -msgid "Total" -msgstr "Total" - -#. module: golem_activity_registration_state -#: model:ir.ui.view,arch_db:golem_activity_registration_state.invoicing_form -msgid "Validate" -msgstr "Valider" - #. module: golem_activity_registration_state #: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_member_form_inherit_registration_state msgid "Validate all draft registrations" @@ -256,11 +158,6 @@ msgstr "Valider toutes les inscriptions" msgid "final" msgstr "final" -#. module: golem_activity_registration_state -#: model:ir.model,name:golem_activity_registration_state.model_golem_activity_registration_invoicing_line -msgid "golem.activity.registration.invoicing.line" -msgstr "golem.activity.registration.invoicing.line" - #. module: golem_activity_registration_state #: selection:golem.activity.registration.invoicing,state:0 msgid "init" diff --git a/golem_activity_registration_state/i18n/golem_activity_registration_state.pot b/golem_activity_registration_state/i18n/golem_activity_registration_state.pot index 6b6e1a6..6147d08 100644 --- a/golem_activity_registration_state/i18n/golem_activity_registration_state.pot +++ b/golem_activity_registration_state/i18n/golem_activity_registration_state.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-20 16:23+0000\n" -"PO-Revision-Date: 2018-07-20 16:23+0000\n" +"POT-Creation-Date: 2018-07-31 17:51+0000\n" +"PO-Revision-Date: 2018-07-31 17:51+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -20,11 +20,6 @@ msgstr "" msgid "Activities" msgstr "" -#. module: golem_activity_registration_state -#: model:ir.ui.view,arch_db:golem_activity_registration_state.invoicing_form -msgid "Activities and Prices" -msgstr "" - #. module: golem_activity_registration_state #: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_line_activity_id msgid "Activity id" @@ -35,49 +30,17 @@ msgstr "" msgid "Canceled" msgstr "" -#. module: golem_activity_registration_state -#: model:ir.ui.view,arch_db:golem_activity_registration_state.invoicing_form -msgid "Close" -msgstr "" - #. module: golem_activity_registration_state #: selection:golem.activity.registration,state:0 msgid "Confirmed" msgstr "" -#. module: golem_activity_registration_state -#: model:ir.ui.view,arch_db:golem_activity_registration_state.invoicing_form -msgid "Congratulations, activities had been confirmed and invoiced." -msgstr "" - -#. module: golem_activity_registration_state -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_create_uid -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_line_create_uid -msgid "Created by" -msgstr "" - -#. module: golem_activity_registration_state -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_create_date -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_line_create_date -msgid "Created on" -msgstr "" - #. module: golem_activity_registration_state #: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_display_name #: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_line_display_name msgid "Display Name" msgstr "" -#. module: golem_activity_registration_state -#: model:ir.ui.view,arch_db:golem_activity_registration_state.invoicing_form -msgid "Display invoice" -msgstr "" - -#. module: golem_activity_registration_state -#: model:ir.ui.view,arch_db:golem_activity_registration_state.invoicing_form -msgid "Display payments" -msgstr "" - #. module: golem_activity_registration_state #: selection:golem.activity.registration,state:0 msgid "Draft" @@ -93,6 +56,11 @@ msgstr "" msgid "GOLEM Activity Registration" msgstr "" +#. module: golem_activity_registration_state +#: model:ir.model,name:golem_activity_registration_state.model_golem_activity_registration_invoicing_line +msgid "GOLEM Activity Registration Invoicing Lines" +msgstr "" + #. module: golem_activity_registration_state #: model:ir.model,name:golem_activity_registration_state.model_golem_activity_registration_invoicing msgid "GOLEM Activity Registration Invoicing Wizard" @@ -104,16 +72,12 @@ msgid "GOLEM Member" msgstr "" #. module: golem_activity_registration_state -#: code:addons/golem_activity_registration_state/wizard/golem_activity_registration_invoicing.py:147 #: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_invoice_id -#, python-format msgid "Generated invoice" msgstr "" #. module: golem_activity_registration_state -#: code:addons/golem_activity_registration_state/wizard/golem_activity_registration_invoicing.py:162 #: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_payment_ids -#, python-format msgid "Generated payments" msgstr "" @@ -122,12 +86,6 @@ msgstr "" msgid "Has draft registrations ?" msgstr "" -#. module: golem_activity_registration_state -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_id -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_line_id -msgid "ID" -msgstr "" - #. module: golem_activity_registration_state #: model:ir.model.fields,help:golem_activity_registration_state.field_golem_activity_registration_invoicing_schedule_id msgid "If no schedule is selected, only the invoice will be create. Otherwise, draft payments will be generated." @@ -135,17 +93,7 @@ msgstr "" #. module: golem_activity_registration_state #: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_member_form_inherit_registration_state -msgid "If you validate draft registration, they will be seen as confirmed. Then, an invoice will be created for the current member." -msgstr "" - -#. module: golem_activity_registration_state -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoice_id -msgid "Invoice Reference" -msgstr "" - -#. module: golem_activity_registration_state -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoice_line_id -msgid "Invoice line" +msgid "If you validate draft registrations, they will be seen as confirmed." msgstr "" #. module: golem_activity_registration_state @@ -164,18 +112,6 @@ msgstr "" msgid "Last Modified on" msgstr "" -#. module: golem_activity_registration_state -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_line_write_uid -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_write_uid -msgid "Last Updated by" -msgstr "" - -#. module: golem_activity_registration_state -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_line_write_date -#: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_write_date -msgid "Last Updated on" -msgstr "" - #. module: golem_activity_registration_state #: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_member_id msgid "Member" @@ -191,11 +127,6 @@ msgstr "" msgid "Payment schedule" msgstr "" -#. module: golem_activity_registration_state -#: model:ir.ui.view,arch_db:golem_activity_registration_state.invoicing_form -msgid "Please confirm activity prices and choose a payment schedule if needed." -msgstr "" - #. module: golem_activity_registration_state #: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_line_price msgid "Price" @@ -206,13 +137,6 @@ msgstr "" msgid "Registration id" msgstr "" -#. module: golem_activity_registration_state -#: code:addons/golem_activity_registration_state/models/golem_activity_registration.py:58 -#: model:ir.ui.view,arch_db:golem_activity_registration_state.invoicing_form -#, python-format -msgid "Registration invoicing" -msgstr "" - #. module: golem_activity_registration_state #: model:ir.model.fields,field_description:golem_activity_registration_state.field_golem_activity_registration_invoicing_season_id msgid "Season" @@ -224,28 +148,6 @@ msgstr "" msgid "State" msgstr "" -#. module: golem_activity_registration_state -#: code:addons/golem_activity_registration_state/wizard/golem_activity_registration_invoicing.py:143 -#, python-format -msgid "There is no generated invoice." -msgstr "" - -#. module: golem_activity_registration_state -#: code:addons/golem_activity_registration_state/wizard/golem_activity_registration_invoicing.py:158 -#, python-format -msgid "There is no generated payments." -msgstr "" - -#. module: golem_activity_registration_state -#: model:ir.ui.view,arch_db:golem_activity_registration_state.invoicing_form -msgid "Total" -msgstr "" - -#. module: golem_activity_registration_state -#: model:ir.ui.view,arch_db:golem_activity_registration_state.invoicing_form -msgid "Validate" -msgstr "" - #. module: golem_activity_registration_state #: model:ir.ui.view,arch_db:golem_activity_registration_state.golem_member_form_inherit_registration_state msgid "Validate all draft registrations" @@ -256,11 +158,6 @@ msgstr "" msgid "final" msgstr "" -#. module: golem_activity_registration_state -#: model:ir.model,name:golem_activity_registration_state.model_golem_activity_registration_invoicing_line -msgid "golem.activity.registration.invoicing.line" -msgstr "" - #. module: golem_activity_registration_state #: selection:golem.activity.registration.invoicing,state:0 msgid "init" diff --git a/golem_activity_registration_state/models/golem_activity_registration.py b/golem_activity_registration_state/models/golem_activity_registration.py index 0be6b8b..5c23e36 100644 --- a/golem_activity_registration_state/models/golem_activity_registration.py +++ b/golem_activity_registration_state/models/golem_activity_registration.py @@ -1,23 +1,23 @@ # -*- coding: utf-8 -*- -# copyright 2017 fabien bourgeois +# Copyright 2017-2018 Fabien Bourgeois # -# 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 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. +# 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 . +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . """ GOLEM Activity Registration State """ -from odoo import models, fields, api, _ +from odoo import models, fields, api class GolemMember(models.Model): """ GOLEM Member adaptations """ @@ -27,40 +27,22 @@ class GolemMember(models.Model): 'Has draft registrations ?', compute='_compute_has_draft_reg') - @api.depends('activity_registration_ids') + @api.depends('activity_registration_ids', 'activity_registration_ids.state') def _compute_has_draft_reg(self): """ Check if there are draft states in member activities """ for member in self: - for reg in member.activity_registration_ids: - if reg.state == 'draft': - member.has_draft_registrations = True - return - member.has_draft_registrations = False + regis = member.activity_registration_ids + regis = regis.filtered(lambda r: r.state == 'draft') + member.has_draft_registrations = bool(len(regis)) @api.multi def do_validate_registrations(self): """ Validate all draft registrations """ self.ensure_one() member = self[0] - draft_registrations = member.activity_registration_ids.filtered( - lambda r: r.state == 'draft') - if draft_registrations: - invoicing = self.env['golem.activity.registration.invoicing'].create({ - 'member_id' : member.id, - 'season_id': draft_registrations[0].activity_id.season_id.id - }) - line_obj = self.env['golem.activity.registration.invoicing.line'] - for reg in draft_registrations: - line_obj.create({'invoicing_id': invoicing.id, - 'registration_id': reg.id, - 'activity_id': reg.activity_id.id, - 'price': reg.activity_id.list_price}) - return {'name': _('Registration invoicing'), - 'type': 'ir.actions.act_window', - 'res_model': 'golem.activity.registration.invoicing', - 'view_mode': 'form', - 'res_id': invoicing.id, - 'target': 'new'} + member.activity_registration_ids.filtered( + lambda r: r.state == 'draft' + ).write({'state': 'confirmed'}) @api.multi def write(self, values): @@ -105,10 +87,6 @@ class GolemActivityRegistration(models.Model): state = fields.Selection([('draft', 'Draft'), ('confirmed', 'Confirmed'), ('canceled', 'Canceled')], required=True, default='draft') - invoice_line_id = fields.Many2one('account.invoice.line', - string='Invoice line', - ondelete='set null') - invoice_id = fields.Many2one(related='invoice_line_id.invoice_id') @api.multi def write(self, values): diff --git a/golem_activity_registration_state/views/golem_activity_registration_views.xml b/golem_activity_registration_state/views/golem_activity_registration_views.xml index b939857..fe8769b 100644 --- a/golem_activity_registration_state/views/golem_activity_registration_views.xml +++ b/golem_activity_registration_state/views/golem_activity_registration_views.xml @@ -1,6 +1,6 @@ - - Registration state specific searches - golem.activity.registration - - - - - diff --git a/golem_activity_registration_state/views/golem_activity_views.xml b/golem_activity_registration_state/views/golem_activity_views.xml index 456d7fe..33f7189 100644 --- a/golem_activity_registration_state/views/golem_activity_views.xml +++ b/golem_activity_registration_state/views/golem_activity_views.xml @@ -1,6 +1,6 @@