From 7b022c66233449744db63a2de61f5dafee99e14e Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Wed, 1 Aug 2018 18:14:45 +0200 Subject: [PATCH] [ADD]GOLEM Activity Registration : invoicing, payment wizard * Add invoicing information on registration ; * Enhance payment wizard by better naming journal. --- .../i18n/fr.po | 35 +++++++++++++++++-- .../golem_activity_registration_payment.pot | 35 +++++++++++++++++-- .../models/golem_activity_registration.py | 2 ++ .../golem_activity_registration_views.xml | 22 +++++++++++- .../golem_activity_registration_invoicing.py | 2 +- .../golem_activity_registration_invoicing.xml | 6 ++-- 6 files changed, 94 insertions(+), 8 deletions(-) diff --git a/golem_activity_registration_payment/i18n/fr.po b/golem_activity_registration_payment/i18n/fr.po index 8e3d299..e034a24 100644 --- a/golem_activity_registration_payment/i18n/fr.po +++ b/golem_activity_registration_payment/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-08-01 14:10+0000\n" -"PO-Revision-Date: 2018-08-01 16:15+0200\n" +"POT-Creation-Date: 2018-08-01 16:18+0000\n" +"PO-Revision-Date: 2018-08-01 18:19+0200\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -39,6 +39,11 @@ msgstr "Activités et tarifs" 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.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoice_line_price +msgid "Amount" +msgstr "Montant" + #. 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" @@ -71,6 +76,11 @@ msgstr "Créé par" msgid "Created on" msgstr "Créé le" +#. module: golem_activity_registration_payment +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_currency_id +msgid "Currency" +msgstr "Devise" + #. module: golem_activity_registration_payment #: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form msgid "Display invoice" @@ -123,11 +133,22 @@ msgstr "Paiements générés" 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_activity_registration_invoicing_view_form +msgid "If the service user wants to pay with several payment methods, please validate with the main one, go to the payments and change journal on those needed." +msgstr "Si l'usager souhaite payer avec différents modes de paiement, merci de valider en sélectionnant le moyen principal, puis affichez les paiements et modifiez ceux impactés." + #. 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.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_form_inherit_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_search_inherit_payment +msgid "Invoice" +msgstr "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" @@ -148,6 +169,11 @@ msgstr "Inscriptions en attente de facturation" msgid "Invoice state" msgstr "Invoice state" +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_form_inherit_payment +msgid "Invoicing" +msgstr "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 @@ -170,6 +196,11 @@ msgstr "Facture Ouverte" msgid "Paid Invoice" msgstr "Facture Payée" +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form +msgid "Payment method" +msgstr "Moyen de paiement" + #. 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." diff --git a/golem_activity_registration_payment/i18n/golem_activity_registration_payment.pot b/golem_activity_registration_payment/i18n/golem_activity_registration_payment.pot index 01596ad..7515414 100644 --- a/golem_activity_registration_payment/i18n/golem_activity_registration_payment.pot +++ b/golem_activity_registration_payment/i18n/golem_activity_registration_payment.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-08-01 14:09+0000\n" -"PO-Revision-Date: 2018-08-01 14:09+0000\n" +"POT-Creation-Date: 2018-08-01 16:18+0000\n" +"PO-Revision-Date: 2018-08-01 16:18+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -35,6 +35,11 @@ msgstr "" msgid "All confirmed registrations had already been invoiced." msgstr "" +#. module: golem_activity_registration_payment +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_invoice_line_price +msgid "Amount" +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" @@ -67,6 +72,11 @@ msgstr "" msgid "Created on" msgstr "" +#. module: golem_activity_registration_payment +#: model:ir.model.fields,field_description:golem_activity_registration_payment.field_golem_activity_registration_currency_id +msgid "Currency" +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" @@ -119,11 +129,22 @@ msgstr "" msgid "Has invoicable registrations ?" msgstr "" +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form +msgid "If the service user wants to pay with several payment methods, please validate with the main one, go to the payments and change journal on those needed." +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.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_form_inherit_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_search_inherit_payment +msgid "Invoice" +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" @@ -144,6 +165,11 @@ msgstr "" msgid "Invoice state" msgstr "" +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_form_inherit_payment +msgid "Invoicing" +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 @@ -166,6 +192,11 @@ msgstr "" msgid "Paid Invoice" msgstr "" +#. module: golem_activity_registration_payment +#: model:ir.ui.view,arch_db:golem_activity_registration_payment.golem_activity_registration_invoicing_view_form +msgid "Payment method" +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." diff --git a/golem_activity_registration_payment/models/golem_activity_registration.py b/golem_activity_registration_payment/models/golem_activity_registration.py index 9aba3b8..b3d5361 100644 --- a/golem_activity_registration_payment/models/golem_activity_registration.py +++ b/golem_activity_registration_payment/models/golem_activity_registration.py @@ -26,6 +26,8 @@ class GolemActivityRegistration(models.Model): invoice_line_id = fields.Many2one('account.invoice.line', string='Invoice line', ondelete='set null') + currency_id = fields.Many2one(related='invoice_line_id.currency_id') + invoice_line_price = fields.Monetary(related='invoice_line_id.price_subtotal') invoice_id = fields.Many2one(related='invoice_line_id.invoice_id') invoice_state = fields.Selection(related='invoice_line_id.invoice_id.state', store=True) diff --git a/golem_activity_registration_payment/views/golem_activity_registration_views.xml b/golem_activity_registration_payment/views/golem_activity_registration_views.xml index 632e8d1..86fb72c 100644 --- a/golem_activity_registration_payment/views/golem_activity_registration_views.xml +++ b/golem_activity_registration_payment/views/golem_activity_registration_views.xml @@ -18,6 +18,26 @@ along with this program. If not, see . + + + Activity Registration form adaptations + golem.activity.registration + + + + + + + + + + + + + + Activity Registration State Tree adaptations @@ -40,7 +60,7 @@ along with this program. If not, see . ref="golem_activity_registration_state.golem_activity_registration_search_inherit_state" /> - + diff --git a/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py b/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py index 48185ba..133db61 100644 --- a/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py +++ b/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py @@ -54,7 +54,7 @@ class GolemActivityRegistrationInvoicing(models.TransientModel): help='If no schedule is selected, only the ' 'invoice will be create. Otherwise, draft ' 'payments will be generated.') - journal_id = fields.Many2one('account.journal', 'Journal', + journal_id = fields.Many2one('account.journal', string='Payment method', domain=[('type', 'in', ('bank', 'cash'))], ondelete='cascade') invoice_id = fields.Many2one('account.invoice', string='Generated invoice', diff --git a/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.xml b/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.xml index 26fdba1..b049cc3 100644 --- a/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.xml +++ b/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.xml @@ -39,11 +39,13 @@ along with this program. If not, see . - - + +

If the service user wants to pay with several payment methods, please validate with the main one, go to the payments and change journal on those needed.

Congratulations, activities had been confirmed and invoiced.