diff --git a/golem_family/i18n/fr.po b/golem_family/i18n/fr.po
index a80e517..8cfd5a4 100644
--- a/golem_family/i18n/fr.po
+++ b/golem_family/i18n/fr.po
@@ -159,7 +159,7 @@ msgstr "Membres de la famille"
#. module: golem_family
#: model:ir.ui.view,arch_db:golem_family.golem_family_form
msgid "Family form"
-msgstr "Family form"
+msgstr "Fiche Famille"
#. module: golem_family
#: model:ir.ui.view,arch_db:golem_family.golem_family_form
diff --git a/golem_membership/__manifest__.py b/golem_membership/__manifest__.py
index 8f4ea04..cd07e0d 100644
--- a/golem_membership/__manifest__.py
+++ b/golem_membership/__manifest__.py
@@ -18,7 +18,7 @@
{
'name': 'GOLEM non-profit membership handling',
'summary': 'Extends Odoo membership',
- 'version': '10.0.1.1.2',
+ 'version': '10.0.1.1.3',
'category': 'GOLEM',
'author': 'Fabien Bourgeois, Michel Dessenne',
'license': 'AGPL-3',
@@ -27,5 +27,5 @@
'depends': ['golem_member', 'account', 'decimal_precision'],
'data': ['views/golem_membership_invoice.xml',
'views/golem_member_view.xml',
- 'report/golem_member_card_template.xml']
+ 'report/golem_member_card_templates.xml']
}
diff --git a/golem_resource/__manifest__.py b/golem_resource/__manifest__.py
index 7fec3ab..155cd46 100644
--- a/golem_resource/__manifest__.py
+++ b/golem_resource/__manifest__.py
@@ -20,7 +20,7 @@
'name': 'GOLEM non-profit resources',
'summary': 'GOLEM resources management',
'description': ''' GOLEM resources management ''',
- 'version': '10.0.1.10.0',
+ 'version': '10.0.1.13.0',
'category': 'GOLEM',
'author': 'Youssef El Ouahby, Fabien Bourgeois',
'license': 'AGPL-3',
diff --git a/golem_resource/i18n/fr.po b/golem_resource/i18n/fr.po
index 12d1750..ddc67ef 100644
--- a/golem_resource/i18n/fr.po
+++ b/golem_resource/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-03-17 08:07+0000\n"
-"PO-Revision-Date: 2018-03-17 08:07+0000\n"
+"POT-Creation-Date: 2018-03-26 15:36+0000\n"
+"PO-Revision-Date: 2018-03-26 15:36+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -95,6 +95,11 @@ msgstr "Confirmer"
msgid "Confirmed"
msgstr "Confirmé"
+#. module: golem_resource
+#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
+msgid "Confirmed, to Validate"
+msgstr "Confirmé, à valider"
+
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard_create_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_create_uid
@@ -134,6 +139,7 @@ msgstr "Nom affiché"
#. module: golem_resource
#: selection:golem.resource.reservation,state:0
+#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Draft"
msgstr "Brouillon"
@@ -320,6 +326,7 @@ msgstr "Rejet"
#. module: golem_resource
#: selection:golem.resource.reservation,state:0
+#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Rejected"
msgstr "Rejeté"
@@ -344,11 +351,6 @@ msgstr "Nombre de réservations"
msgid "Reservation id"
msgstr "Reservation id"
-#. module: golem_resource
-#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
-msgid "Reservation to Validate"
-msgstr "Réservation à valider"
-
#. module: golem_resource
#: model:ir.actions.act_window,name:golem_resource.golem_resource_reservation_action
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_ids
@@ -407,6 +409,11 @@ msgstr "Ressources"
msgid "Saturday"
msgstr "Samedi"
+#. module: golem_resource
+#: model:ir.ui.menu,name:golem_resource.product_template_menu
+msgid "Sellable Products"
+msgstr "Articles en vente"
+
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form
msgid "Set to draft"
@@ -499,6 +506,7 @@ msgstr "Valider"
#. module: golem_resource
#: selection:golem.resource.reservation,state:0
+#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Validated"
msgstr "Validé"
diff --git a/golem_resource/i18n/golem_resource.pot b/golem_resource/i18n/golem_resource.pot
index 1ed1a5f..80852e2 100644
--- a/golem_resource/i18n/golem_resource.pot
+++ b/golem_resource/i18n/golem_resource.pot
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2018-03-17 08:07+0000\n"
-"PO-Revision-Date: 2018-03-17 08:07+0000\n"
+"POT-Creation-Date: 2018-03-26 15:37+0000\n"
+"PO-Revision-Date: 2018-03-26 15:37+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -95,6 +95,11 @@ msgstr ""
msgid "Confirmed"
msgstr ""
+#. module: golem_resource
+#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
+msgid "Confirmed, to Validate"
+msgstr ""
+
#. module: golem_resource
#: model:ir.model.fields,field_description:golem_resource.field_golem_reservation_rejection_wizard_create_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_create_uid
@@ -134,6 +139,7 @@ msgstr ""
#. module: golem_resource
#: selection:golem.resource.reservation,state:0
+#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Draft"
msgstr ""
@@ -320,6 +326,7 @@ msgstr ""
#. module: golem_resource
#: selection:golem.resource.reservation,state:0
+#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Rejected"
msgstr ""
@@ -344,11 +351,6 @@ msgstr ""
msgid "Reservation id"
msgstr ""
-#. module: golem_resource
-#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
-msgid "Reservation to Validate"
-msgstr ""
-
#. module: golem_resource
#: model:ir.actions.act_window,name:golem_resource.golem_resource_reservation_action
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_ids
@@ -407,6 +409,11 @@ msgstr ""
msgid "Saturday"
msgstr ""
+#. module: golem_resource
+#: model:ir.ui.menu,name:golem_resource.product_template_menu
+msgid "Sellable Products"
+msgstr ""
+
#. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form
msgid "Set to draft"
@@ -499,6 +506,7 @@ msgstr ""
#. module: golem_resource
#: selection:golem.resource.reservation,state:0
+#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Validated"
msgstr ""
diff --git a/golem_resource/views/golem_resource_reservation_views.xml b/golem_resource/views/golem_resource_reservation_views.xml
index 03c2063..03f05e3 100644
--- a/golem_resource/views/golem_resource_reservation_views.xml
+++ b/golem_resource/views/golem_resource_reservation_views.xml
@@ -24,10 +24,12 @@ along with this program. If not, see .
GOLEM Resource Reservation Calendargolem.resource.reservation
-
+
-
+
@@ -37,12 +39,14 @@ along with this program. If not, see .
GOLEM Resource Reservation Treegolem.resource.reservation
-
+
+
+
@@ -70,7 +74,7 @@ along with this program. If not, see .
-
+
@@ -79,7 +83,7 @@ along with this program. If not, see .
-
+
@@ -109,12 +113,28 @@ along with this program. If not, see .
+
-
+
+
+
+
+
+
+ .
+
diff --git a/golem_resource_account/__init__.py b/golem_resource_account/__init__.py
new file mode 100644
index 0000000..f95e908
--- /dev/null
+++ b/golem_resource_account/__init__.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+
+# Copyright 2018 Youssef El Ouahby
+# 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_resource_account/__manifest__.py b/golem_resource_account/__manifest__.py
new file mode 100644
index 0000000..fb647c3
--- /dev/null
+++ b/golem_resource_account/__manifest__.py
@@ -0,0 +1,32 @@
+# -*- coding: utf-8 -*-
+
+# Copyright 2018 Youssef El Ouahby
+# 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 resources invoicing',
+ 'summary': 'GOLEM resources invoicing',
+ 'description': ''' GOLEM resources invoicing ''',
+ 'version': '10.0.0.1.3',
+ 'category': 'GOLEM',
+ 'author': 'Youssef El Ouahby, Fabien Bourgeois',
+ 'license': 'AGPL-3',
+ 'application': True,
+ 'installable': True,
+ 'depends': ['golem_resource', 'account'],
+ 'data': ['wizard/golem_reservation_invoice_views.xml',
+ 'views/golem_resource_reservation_views.xml']
+}
diff --git a/golem_resource_account/i18n/fr.po b/golem_resource_account/i18n/fr.po
new file mode 100644
index 0000000..7ab3f0b
--- /dev/null
+++ b/golem_resource_account/i18n/fr.po
@@ -0,0 +1,213 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * golem_resource_account
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 10.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2018-03-27 09:41+0000\n"
+"PO-Revision-Date: 2018-03-27 09:41+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_resource_account
+#: model:ir.model.fields,help:golem_resource_account.field_golem_resource_reservation_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_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_reservation_invoice_wizard_form
+msgid "\n"
+" Only one invoice will be created in draft with corresponding reservations.\n"
+" Then, you will be redirected to the new invoice and can review it before validation.\n"
+" "
+msgstr "\n"
+" Seule unef acture sera créée en brouillon avec les réservations sélectionnées.\n"
+" Ensuite, vous serez redirigé vers cette facture et pourrez la visionner avant de la valider.\n"
+" "
+
+#. module: golem_resource_account
+#: model:ir.model.fields,help:golem_resource_account.field_golem_resource_reservation_resource_product_id
+msgid "A generic product can be linked, in order to sell reservations (work in progress)"
+msgstr "Un article générique peut être lié, dans l'objectif de monétiser des réservations (à venir)"
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_resource_reservation_invoice_line_price_subtotal
+msgid "Amount"
+msgstr "Montant"
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_reservation_invoice_wizard_form
+msgid "Cancel"
+msgstr "Annuler"
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_resource_reservation_form_inherit_golem_resource_account
+msgid "Create Invoice"
+msgstr "Créer une facture"
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_reservation_invoice_wizard_form
+msgid "Create and view invoice"
+msgstr "Créer et afficher la facture"
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_reservation_invoice_wizard_form
+msgid "Create invoice and Close"
+msgstr "Créer la facture et fermer"
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_reservation_invoice_wizard_create_uid
+msgid "Created by"
+msgstr "Créé par"
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_reservation_invoice_wizard_create_date
+msgid "Created on"
+msgstr "Créé le"
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_resource_reservation_currency_id
+msgid "Currency"
+msgstr "Devise"
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_reservation_invoice_wizard_display_name
+msgid "Display Name"
+msgstr "Nom affiché"
+
+#. module: golem_resource_account
+#: model:ir.model,name:golem_resource_account.model_golem_resource_reservation
+msgid "GOLEM Reservation Model"
+msgstr "GOLEM Reservation Model"
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_reservation_invoice_wizard_id
+msgid "ID"
+msgstr "ID"
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_resource_reservation_invoice_id
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_resource_reservation_search_inherit_golem_resource_account
+msgid "Invoice"
+msgstr "Facture"
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_resource_reservation_invoice_line_id
+msgid "Invoice line id"
+msgstr "Ligne de facturation"
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_resource_reservation_search_inherit_golem_resource_account
+msgid "Invoice state"
+msgstr "État de la facture"
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_resource_reservation_tree_inherit_golem_resource_account
+msgid "Invoice status"
+msgstr "État de facturation"
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_resource_reservation_search_inherit_golem_resource_account
+msgid "Invoiced"
+msgstr "Facturé"
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_resource_reservation_form_inherit_golem_resource_account
+msgid "Invoicing"
+msgstr "Facturation"
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_reservation_invoice_wizard___last_update
+msgid "Last Modified on"
+msgstr "Dernière Modification le"
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_reservation_invoice_wizard_write_uid
+msgid "Last Updated by"
+msgstr "Dernière mise à jour par"
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_reservation_invoice_wizard_write_date
+msgid "Last Updated on"
+msgstr "Dernière mise à jour le"
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_resource_reservation_resource_product_id
+msgid "Linked product"
+msgstr "Article lié"
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_resource_reservation_search_inherit_golem_resource_account
+msgid "Not invoiced"
+msgstr "Non facturé"
+
+#. module: golem_resource_account
+#: model:ir.actions.act_window,name:golem_resource_account.action_golem_reservation_invoice_wizard
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_reservation_invoice_wizard_reservation_ids
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_reservation_invoice_wizard_form
+msgid "Reservations to invoice"
+msgstr "Facturer les réservations"
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_resource_reservation_form_inherit_golem_resource_account
+msgid "Show invoice"
+msgstr "Voir la facture"
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_resource_reservation_invoice_state
+msgid "Status"
+msgstr "État"
+
+#. module: golem_resource_account
+#: code:addons/golem_resource_account/models/golem_resource_reservation.py:50
+#, python-format
+msgid "The reservation \"{}\" is not validated, please validate it before creating invoice"
+msgstr "La réservation \"{}\" n'est pas validée, merci de la valider avant de créer une facture"
+
+#. module: golem_resource_account
+#: code:addons/golem_resource_account/models/golem_resource_reservation.py:66
+#, python-format
+msgid "There is no income account defined for this product: \"{}\". You have to configure it on the product form."
+msgstr "Il n'y a pas de compte de revenus défini pour cet article: \"{}\". Vous devez en configurer un sur la fiche article."
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_resource_reservation_invoice_amount_total
+msgid "Total"
+msgstr "Total"
+
+#. module: golem_resource_account
+#: code:addons/golem_resource_account/models/golem_resource_reservation.py:52
+#, python-format
+msgid "You can not create an invoice as there is already one."
+msgstr "Vous ne pouvez pa créer une facture s'il y en a déjà une existante."
+
+#. module: golem_resource_account
+#: code:addons/golem_resource_account/models/golem_resource_reservation.py:57
+#, python-format
+msgid "You can not create an invoice without linked product on the resource reserved."
+msgstr "Vous ne pouvez pas créer de facture sans article liée à la ressource réservée."
+
+#. module: golem_resource_account
+#: code:addons/golem_resource_account/models/golem_resource_reservation.py:43
+#, python-format
+msgid "You can't group reservations of multiple clients in the same invoice, please remove inadequate reservations"
+msgstr "Vous ne pouvez pas regrouper des réservations pour plusieurs partenaires. Merci de sélectionner seulement des réservations ayant trait à un même partenaire."
+
+#. module: golem_resource_account
+#: model:ir.model,name:golem_resource_account.model_golem_reservation_invoice_wizard
+msgid "golem.reservation.invoice.wizard"
+msgstr "golem.reservation.invoice.wizard"
diff --git a/golem_resource_account/i18n/golem_resource_account.pot b/golem_resource_account/i18n/golem_resource_account.pot
new file mode 100644
index 0000000..a9df4dc
--- /dev/null
+++ b/golem_resource_account/i18n/golem_resource_account.pot
@@ -0,0 +1,207 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * golem_resource_account
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 10.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2018-03-27 09:39+0000\n"
+"PO-Revision-Date: 2018-03-27 09:39+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_resource_account
+#: model:ir.model.fields,help:golem_resource_account.field_golem_resource_reservation_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_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_reservation_invoice_wizard_form
+msgid "\n"
+" Only one invoice will be created in draft with corresponding reservations.\n"
+" Then, you will be redirected to the new invoice and can review it before validation.\n"
+" "
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.model.fields,help:golem_resource_account.field_golem_resource_reservation_resource_product_id
+msgid "A generic product can be linked, in order to sell reservations (work in progress)"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_resource_reservation_invoice_line_price_subtotal
+msgid "Amount"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_reservation_invoice_wizard_form
+msgid "Cancel"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_resource_reservation_form_inherit_golem_resource_account
+msgid "Create Invoice"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_reservation_invoice_wizard_form
+msgid "Create and view invoice"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_reservation_invoice_wizard_form
+msgid "Create invoice and Close"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_reservation_invoice_wizard_create_uid
+msgid "Created by"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_reservation_invoice_wizard_create_date
+msgid "Created on"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_resource_reservation_currency_id
+msgid "Currency"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_reservation_invoice_wizard_display_name
+msgid "Display Name"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.model,name:golem_resource_account.model_golem_resource_reservation
+msgid "GOLEM Reservation Model"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_reservation_invoice_wizard_id
+msgid "ID"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_resource_reservation_invoice_id
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_resource_reservation_search_inherit_golem_resource_account
+msgid "Invoice"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_resource_reservation_invoice_line_id
+msgid "Invoice line id"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_resource_reservation_search_inherit_golem_resource_account
+msgid "Invoice state"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_resource_reservation_tree_inherit_golem_resource_account
+msgid "Invoice status"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_resource_reservation_search_inherit_golem_resource_account
+msgid "Invoiced"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_resource_reservation_form_inherit_golem_resource_account
+msgid "Invoicing"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_reservation_invoice_wizard___last_update
+msgid "Last Modified on"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_reservation_invoice_wizard_write_uid
+msgid "Last Updated by"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_reservation_invoice_wizard_write_date
+msgid "Last Updated on"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_resource_reservation_resource_product_id
+msgid "Linked product"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_resource_reservation_search_inherit_golem_resource_account
+msgid "Not invoiced"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.actions.act_window,name:golem_resource_account.action_golem_reservation_invoice_wizard
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_reservation_invoice_wizard_reservation_ids
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_reservation_invoice_wizard_form
+msgid "Reservations to invoice"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.ui.view,arch_db:golem_resource_account.golem_resource_reservation_form_inherit_golem_resource_account
+msgid "Show invoice"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_resource_reservation_invoice_state
+msgid "Status"
+msgstr ""
+
+#. module: golem_resource_account
+#: code:addons/golem_resource_account/models/golem_resource_reservation.py:50
+#, python-format
+msgid "The reservation \"{}\" is not validated, please validate it before creating invoice"
+msgstr ""
+
+#. module: golem_resource_account
+#: code:addons/golem_resource_account/models/golem_resource_reservation.py:66
+#, python-format
+msgid "There is no income account defined for this product: \"{}\". You have to configure it on the product form."
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.model.fields,field_description:golem_resource_account.field_golem_resource_reservation_invoice_amount_total
+msgid "Total"
+msgstr ""
+
+#. module: golem_resource_account
+#: code:addons/golem_resource_account/models/golem_resource_reservation.py:52
+#, python-format
+msgid "You can not create an invoice as there is already one."
+msgstr ""
+
+#. module: golem_resource_account
+#: code:addons/golem_resource_account/models/golem_resource_reservation.py:57
+#, python-format
+msgid "You can not create an invoice without linked product on the resource reserved."
+msgstr ""
+
+#. module: golem_resource_account
+#: code:addons/golem_resource_account/models/golem_resource_reservation.py:43
+#, python-format
+msgid "You can't group reservations of multiple clients in the same invoice, please remove inadequate reservations"
+msgstr ""
+
+#. module: golem_resource_account
+#: model:ir.model,name:golem_resource_account.model_golem_reservation_invoice_wizard
+msgid "golem.reservation.invoice.wizard"
+msgstr ""
+
diff --git a/golem_resource_account/models/__init__.py b/golem_resource_account/models/__init__.py
new file mode 100644
index 0000000..15dcb5c
--- /dev/null
+++ b/golem_resource_account/models/__init__.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+
+# Copyright 2018 Youssef El Ouahby
+# 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_resource_reservation
diff --git a/golem_resource_account/models/golem_resource_reservation.py b/golem_resource_account/models/golem_resource_reservation.py
new file mode 100644
index 0000000..a18ad91
--- /dev/null
+++ b/golem_resource_account/models/golem_resource_reservation.py
@@ -0,0 +1,119 @@
+# -*- coding: utf-8 -*-
+
+# Copyright 2018 Youssef El Ouahby
+# 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 Resource Reservation Adaptation"""
+
+from odoo import models, fields, api, _
+from odoo.exceptions import ValidationError
+
+
+class GolemResourceReservation(models.Model):
+ """ GOLEM Resource Reservation Adaptation """
+ _inherit = 'golem.resource.reservation'
+
+ resource_product_id = fields.Many2one(related='resource_id.product_tmpl_id')
+ invoice_line_id = fields.Many2one('account.invoice.line', copy=False)
+ invoice_line_price_subtotal = fields.Monetary(related='invoice_line_id.price_subtotal')
+ invoice_id = fields.Many2one(related='invoice_line_id.invoice_id',
+ string='Invoice')
+ invoice_state = fields.Selection(related='invoice_id.state', store=True,
+ copy=False)
+ invoice_amount_total = fields.Monetary(related='invoice_id.amount_total')
+ currency_id = fields.Many2one(related='invoice_id.currency_id')
+
+ @api.multi
+ def check_before_invoicing(self):
+ """ Checks data coherence before invoicing """
+ if len(self.mapped('partner_id')) > 1:
+ raise ValidationError(_('You can\'t group reservations of multiple '
+ 'clients in the same invoice, please remove '
+ 'inadequate reservations'))
+ for reservation in self:
+ if reservation.state != "validated":
+ raise ValidationError(
+ _('The reservation "{}" is not validated, please validate '
+ 'it before creating invoice'.format(reservation.name)))
+ if reservation.invoice_line_id:
+ raise ValidationError(_('You can not create an invoice as there '
+ 'is already one.'))
+ product = reservation.resource_id.product_tmpl_id
+
+ if not product:
+ raise ValidationError(_('You can not create an invoice without '
+ 'linked product on the resource reserved.'))
+
+ account_id = product.property_account_income_id.id or \
+ product.categ_id.property_account_income_categ_id.id
+
+ if not account_id:
+ raise ValidationError(
+ _('There is no income account defined for this product: "{}"'
+ '. You have to configure it on the product form.'.format(product.name)))
+
+ @api.multi
+ def create_invoice_line(self, invoice_id):
+ """ Create invoice line corresponding to reservation """
+ for reservation in self:
+ product = reservation.resource_id.product_tmpl_id
+ amount = product.list_price
+ account_id = product.property_account_income_id.id or \
+ product.categ_id.property_account_income_categ_id.id
+ delta = fields.Datetime.from_string(reservation.date_stop) - \
+ fields.Datetime.from_string(reservation.date_start)
+ quantity = (delta.days * 24) + (delta.seconds/3600.0)
+
+ line_id = self.env['account.invoice.line'].create({
+ 'invoice_id': invoice_id.id,
+ 'name': product.name,
+ 'origin': reservation.name,
+ 'price_unit': amount,
+ 'quantity': quantity,
+ 'uom_id': product.uom_id.id,
+ 'account_id': account_id,
+ 'product_id': product.product_variant_id.id,
+ })
+ reservation.invoice_line_id = line_id
+
+ @api.multi
+ def create_invoice(self):
+ """ Invoice creation """
+ for reservation in self:
+ reservation.check_before_invoicing()
+ inv_obj = self.env['account.invoice']
+ partner_id = reservation.partner_id
+
+ invoice_id = inv_obj.create({
+ 'origin': reservation.name,
+ 'type': 'out_invoice',
+ 'reference': False,
+ 'account_id': partner_id.property_account_receivable_id.id,
+ 'partner_id': partner_id.id
+ })
+ reservation.create_invoice_line(invoice_id)
+
+ @api.multi
+ def show_invoice(self):
+ """ Redirects to linked invoice """
+ self.ensure_one()
+ reservation = self[0]
+ if reservation.invoice_id:
+ return {'type': 'ir.actions.act_window',
+ 'res_model': 'account.invoice',
+ 'res_id': reservation.invoice_id.id,
+ 'view_mode': 'form',
+ 'view_id': self.env.ref('account.invoice_form').id}
diff --git a/golem_resource_account/tests/__init__.py b/golem_resource_account/tests/__init__.py
new file mode 100644
index 0000000..59f0980
--- /dev/null
+++ b/golem_resource_account/tests/__init__.py
@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+
+# Copyright 2018 Youssef El Ouahby
+# 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 test_golem_reservation_invoice
diff --git a/golem_resource_account/tests/test_golem_reservation_invoice.py b/golem_resource_account/tests/test_golem_reservation_invoice.py
new file mode 100644
index 0000000..79c5119
--- /dev/null
+++ b/golem_resource_account/tests/test_golem_reservation_invoice.py
@@ -0,0 +1,120 @@
+# -*- coding: utf-8 -*-
+
+# Copyright 2018 Youssef El Ouahby
+# 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 Resource Reservation testing """
+
+import logging
+from odoo.tests.common import TransactionCase
+from odoo.exceptions import ValidationError
+_LOGGER = logging.getLogger(__name__)
+
+
+class TestGolemResourceReservation(TransactionCase):
+ """ GOLEM Resource Reservation testing """
+
+ def setUp(self, *args, **kwargs):
+ """ Bootstrap Resource Reservation """
+ super(TestGolemResourceReservation, self).setUp(*args, **kwargs)
+ self.product = self.env['product.template'].create({
+ 'name': 'Product',
+ 'categ_id': self.env.ref('product.product_category_all').id,
+ 'list_price': 7.0,
+ 'type': 'service',
+ 'uom_id': self.env.ref('product.product_uom_hour').id,
+ 'uom_po_id': self.env.ref('product.product_uom_hour').id,
+ 'property_account_income_id': self.env.ref('l10n_fr.pcg_706').id
+ })
+ self.resource = self.env['golem.resource'].create({
+ 'name': 'Resource',
+ 'avaibility_start': '2018-01-01',
+ 'avaibility_stop': '2020-01-01',
+ 'availibility_24_7': True
+ })
+
+ self.partner = self.env['res.partner'].create({'firstname': 'John',
+ 'lastname': 'DOE',
+ 'is_company': False})
+ self.partner2 = self.env['res.partner'].create({'firstname': 'John',
+ 'lastname': 'DOE',
+ 'is_company': False})
+ self.data = {
+ 'resource_id': self.resource.id,
+ 'date_start': '2018-02-05 11:00:00', # is monday
+ 'date_stop': '2018-02-05 12:00:00',
+ 'partner_id': self.partner.id
+ }
+ self.data2 = {
+ 'resource_id': self.resource.id,
+ 'date_start': '2018-03-05 11:00:00', # is monday
+ 'date_stop': '2018-03-05 12:00:00',
+ 'partner_id': self.partner2.id
+ }
+ self.res_obj = self.env['golem.resource.reservation']
+
+
+ def test_single_reservation_invoice(self):
+ """ Test reservation bases """
+ reservation = self.res_obj.create(self.data)
+ self.assertEqual(reservation.state, 'draft')
+ self.assertFalse(reservation.invoice_id)
+
+ #try to create invoice withoud validating reservation
+ with self.assertRaises(ValidationError) as err:
+ reservation.create_invoice()
+ self.assertIn(u'is not validated, please validate it', err.exception.args[0])
+ reservation.state_confirm()
+
+ #try to create invoice with no product linked
+ with self.assertRaises(ValidationError) as err:
+ reservation.create_invoice()
+ self.assertIn(u'without linked product', err.exception.args[0])
+
+ reservation.resource_id.write({'product_tmpl_id': self.product.id})
+ reservation.create_invoice()
+ self.assertTrue(reservation.invoice_id)
+ self.assertEqual(reservation.invoice_id.state, 'draft')
+
+ def test_multiple_reservation_in(self):
+ """ Test Multiple Reservation Invoices """
+ reservation_1 = self.res_obj.create(self.data)
+ reservation_2 = self.res_obj.create(self.data2)
+ reservation_1.state_confirm()
+ reservation_2.state_confirm()
+ self.assertEqual(reservation_1.state, 'validated')
+ self.assertEqual(reservation_2.state, 'validated')
+
+ reservation_1.resource_id.product_tmpl_id = self.product.id
+ reservation_2.resource_id.product_tmpl_id = self.product.id
+
+ wizard = self.env['golem.reservation.invoice.wizard'].create({
+ 'reservation_ids': [(4, reservation_1.id, 0), (4, reservation_2.id, 0)]})
+ self.assertTrue(wizard.reservation_ids)
+ self.assertEqual(wizard.reservation_ids[0], reservation_2)
+ self.assertEqual(wizard.reservation_ids[1], reservation_1)
+
+ #try to create invoice for to different client
+ with self.assertRaises(ValidationError) as err:
+ wizard.create_invoice()
+ self.assertIn(u'group reservations of multiple clients in the same',
+ err.exception.args[0])
+
+ #fixing the same client for both reservation
+ reservation_2.write({'partner_id': self.partner.id})
+ wizard.create_invoice()
+ self.assertTrue(reservation_1.invoice_id)
+ self.assertTrue(reservation_2.invoice_id)
diff --git a/golem_resource_account/views/golem_resource_reservation_views.xml b/golem_resource_account/views/golem_resource_reservation_views.xml
new file mode 100644
index 0000000..a17150c
--- /dev/null
+++ b/golem_resource_account/views/golem_resource_reservation_views.xml
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+ GOLEM Resource Reservation Tree Adaptation to invoicing
+ golem.resource.reservation
+
+
+
+
+
+
+
+
+
+
+
+ GOLEM Resource Reservation Form Adaptations to invoicing
+ golem.resource.reservation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GOLEM Resource Reservation Search Adaptations
+ golem.resource.reservation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/golem_resource_account/wizard/__init__.py b/golem_resource_account/wizard/__init__.py
new file mode 100644
index 0000000..7f04c05
--- /dev/null
+++ b/golem_resource_account/wizard/__init__.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+
+# Copyright 2018 Youssef El Ouahby
+# 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_reservation_invoice
diff --git a/golem_resource_account/wizard/golem_reservation_invoice.py b/golem_resource_account/wizard/golem_reservation_invoice.py
new file mode 100644
index 0000000..ec3edde
--- /dev/null
+++ b/golem_resource_account/wizard/golem_reservation_invoice.py
@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+
+# Copyright 2018 Youssef El Ouahby
+# 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 Reservation Invoice Wizard"""
+
+from odoo import models, fields, api
+
+
+class GolemReservationInvoiceWizard(models.TransientModel):
+ """ GOLEM Resource Reservation Invoice Wizard """
+ _name = 'golem.reservation.invoice.wizard'
+
+ reservation_ids = fields.Many2many(
+ 'golem.resource.reservation', required=True, string='Reservations to invoice',
+ default=lambda self: self._context.get('active_ids', []))
+
+ @api.multi
+ def create_invoice(self):
+ """ Invoice creation """
+ self.ensure_one()
+
+ self.reservation_ids.check_before_invoicing()
+ self.reservation_ids[0].create_invoice()
+ invoice_id = self.reservation_ids[0].invoice_id
+ if len(self.reservation_ids) > 1:
+ self.reservation_ids[1:].create_invoice_line(invoice_id)
+
+ if self._context.get('open_invoice', False):
+ return self.reservation_ids[0].show_invoice()
+ return {'type': 'ir.actions.act_window_close'}
diff --git a/golem_resource_account/wizard/golem_reservation_invoice_views.xml b/golem_resource_account/wizard/golem_reservation_invoice_views.xml
new file mode 100644
index 0000000..71ba8f5
--- /dev/null
+++ b/golem_resource_account/wizard/golem_reservation_invoice_views.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+ GOLEM Reservation Invoice Wizard Form
+ golem.reservation.invoice.wizard
+
+
+
+
+
+
+