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..5a846dd 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.12.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..0eb7b04 100644 --- a/golem_resource/views/golem_resource_reservation_views.xml +++ b/golem_resource/views/golem_resource_reservation_views.xml @@ -70,7 +70,7 @@ along with this program. If not, see . - + @@ -79,7 +79,7 @@ along with this program. If not, see . - + @@ -113,8 +113,14 @@ along with this program. If not, see . - + + + . + diff --git a/golem_resource_account/__manifest__.py b/golem_resource_account/__manifest__.py index 7451bd4..2ebd21b 100644 --- a/golem_resource_account/__manifest__.py +++ b/golem_resource_account/__manifest__.py @@ -26,8 +26,7 @@ 'license': 'AGPL-3', 'application': True, 'installable': True, - 'depends': ['golem_resource', - 'account'], - 'data': ['views/golem_resource_reservation_views.xml', - 'wizard/golem_reservation_invoice.xml'] + '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..9265b41 --- /dev/null +++ b/golem_resource_account/i18n/fr.po @@ -0,0 +1,192 @@ +# 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-26 15:14+0000\n" +"PO-Revision-Date: 2018-03-26 15:14+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_reservation_invoice_wizard_form +#: 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.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:57 +#, 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:43 +#, 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:48 +#, 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 +#: 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..1ec74ce --- /dev/null +++ b/golem_resource_account/i18n/golem_resource_account.pot @@ -0,0 +1,186 @@ +# 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-26 15:13+0000\n" +"PO-Revision-Date: 2018-03-26 15:13+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_reservation_invoice_wizard_form +#: 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.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:57 +#, 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:43 +#, 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:48 +#, python-format +msgid "You can not create an invoice without linked product on the resource reserved." +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/golem_resource_reservation.py b/golem_resource_account/models/golem_resource_reservation.py index c362c20..7c99e60 100644 --- a/golem_resource_account/models/golem_resource_reservation.py +++ b/golem_resource_account/models/golem_resource_reservation.py @@ -18,101 +18,98 @@ """ GOLEM Resource Reservation Adaptation""" - from odoo import models, fields, api, _ -from odoo.exceptions import UserError +from odoo.exceptions import ValidationError class GolemResourceReservation(models.Model): """ GOLEM Resource Reservation Adaptation """ _inherit = 'golem.resource.reservation' - invoice_id = fields.Many2one('account.invoice') - invoicing_state = fields.Char(compute="_compute_invoicing_state", - search='_search_invoicing_state', - string="Invoicing Status", - default="None") - - def _search_invoicing_state(self, operator, value): - if value == "None": - reservation = self.env['golem.resource.reservation'].search( - [('invoice_id', '=', False)]) - return [('id', 'in', reservation.mapped('id'))] - else: - return [('invoice_id.state', operator, value)] + 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 - @api.depends('invoice_id') - def _compute_invoicing_state(self): - """ Compute invoicing_state """ + def check_before_invoicing(self): + """ Checks data coherence before invoicing """ for reservation in self: - if reservation.invoice_id: - reservation.invoicing_state = reservation.invoice_id.state - else: - reservation.invoicing_state = "None" + 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 open_invoice(self): - """ open invoice """ + def create_invoice_line(self, invoice_id): + """ Create invoice line corresponding to reservation """ for reservation in self: - if reservation.invoice_id: - return {'name' : _('Reservation Invoice'), - '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, - 'target': 'current'} + 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.id, + }) + reservation.invoice_line_id = line_id @api.multi def create_invoice(self): - """ Create invoice """ + """ Invoice creation """ for reservation in self: - if reservation.state != "validated": - raise UserError( - _("The reservation '%s' is not validated, please validate it before \ - creating invoice") % reservation.name) - + reservation.check_before_invoicing() inv_obj = self.env['account.invoice'] partner_id = reservation.partner_id - product = reservation.resource_id.product_tmpl_id - amount = product.standard_price - delta = fields.Datetime.from_string(reservation.date_stop) - \ - fields.Datetime.from_string(reservation.date_start) - quantity = (delta.days * 24) + (delta.seconds/3600.0) - account_id = False - if not product: - raise UserError( - _("There is no product linked to resource : '%s', you can't invoice \ - reservation with no product linked") % (reservation.resource_id.name,)) - if product.id: - account_id = product.property_account_income_id.id - if not account_id: - account_id = product.categ_id.property_account_income_categ_id.id - - if not account_id: - raise UserError( - _('There is no income account defined for this product: "%s". \ - You may have to install a chart of account from Accounting \ - app, settings menu.') % (product.name,)) - invoice = inv_obj.create({ - 'name': reservation.name, + 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, - 'invoice_line_ids': [(0, 0, { - 'name': reservation.resource_id.name, - #'origin': , - 'account_id': account_id, - 'price_unit': amount, - 'quantity': quantity, - 'discount': 0.0, - 'uom_id': product.uom_id.id, - 'product_id': product.id, - })], - }) - reservation.invoice_id = invoice.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/views/golem_resource_reservation_views.xml b/golem_resource_account/views/golem_resource_reservation_views.xml index dafcdd9..df7c05e 100644 --- a/golem_resource_account/views/golem_resource_reservation_views.xml +++ b/golem_resource_account/views/golem_resource_reservation_views.xml @@ -28,7 +28,8 @@ along with this program. If not, see . red : invoicing_state=='open'; green : invoicing_state=='paid'; black: state=='draft'; blue : state=='validated'; grey : state=='canceled'; orange : state=='rejected' - + + @@ -41,37 +42,51 @@ along with this program. If not, see . - - - + + + + + + + + + + - GOLEM Resource Reservation Search Adaptations to invoicing + GOLEM Resource Reservation Search Adaptations golem.resource.reservation - + - - - - - - + + + + + + + + + + + - --> + + . src_model="golem.resource.reservation" view_mode="form" multi="True" - target="new" - /> + target="new" /> + diff --git a/golem_resource_account/wizard/golem_reservation_invoice.py b/golem_resource_account/wizard/golem_reservation_invoice.py index 07de384..ec3edde 100644 --- a/golem_resource_account/wizard/golem_reservation_invoice.py +++ b/golem_resource_account/wizard/golem_reservation_invoice.py @@ -18,86 +18,28 @@ """ GOLEM Reservation Invoice Wizard""" -from odoo import models, fields, api, _ -from odoo.exceptions import ValidationError, UserError +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', - default=lambda self: self._context.get('active_ids', []), - string='Reservations to invoice') + 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_invoices(self): - """ Create invoices for reservation """ + def create_invoice(self): + """ Invoice creation """ self.ensure_one() - if self.reservation_ids: - inv_obj = self.env['account.invoice'] - partner_id = self.reservation_ids[0].partner_id - product = self.reservation_ids[0].resource_id.product_tmpl_id + 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 product.id: - account_id = product.property_account_income_id.id - if not account_id: - account_id = product.categ_id.property_account_income_categ_id.id - if not account_id: - raise UserError( - _('There is no income account defined for this product: "%s". \ - You may have to install a chart of account from Accounting \ - app, settings menu.') % (product.name,)) - - lines = [] - - for reservation in self.reservation_ids: - if reservation.state != "validated": - raise UserError( - _("The reservation '%s' is not validated, please validate it before \ - creating invoice") % reservation.name) - product = reservation.resource_id.product_tmpl_id - if not product: - raise UserError( - _("There is no product linked to resource : '%s', you can't invoice \ - reservation with no product linked") % (reservation.resource_id.name,)) - if partner_id != reservation.partner_id: - raise UserError( - _("You can't group reservations of multiple clients in the same \ - invoice, please remove inadequate reservations")) - - amount = product.standard_price - delta = fields.Datetime.from_string(reservation.date_stop) - \ - fields.Datetime.from_string(reservation.date_start) - - quantity = (delta.days * 24) + (delta.seconds/3600.0) - lines.append((0, 0, { - 'name': reservation.resource_id.name, - #'origin': , - 'account_id': account_id, - 'price_unit': amount, - 'quantity': quantity, - 'discount': 0.0, - 'uom_id': product.uom_id.id, - 'product_id': product.id, - })) - invoice = inv_obj.create({ - #'name': reservation.name, - #'origin': , - 'type': 'out_invoice', - 'reference': False, - 'account_id': partner_id.property_account_receivable_id.id, - 'partner_id': partner_id.id, - 'invoice_line_ids': lines, - }) - self.reservation_ids.write({'invoice_id': invoice.id}) - if self._context.get('open_invoices', False): - return {'name' : _('Reservation Invoice'), - 'type' : 'ir.actions.act_window', - 'res_model' : 'account.invoice', - 'res_id' : invoice.id, - 'view_mode': 'form', - 'view_id': self.env.ref('account.invoice_form').id, - 'target': 'current'} - return {'type': 'ir.actions.act_window_close'} + 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.xml b/golem_resource_account/wizard/golem_reservation_invoice_views.xml similarity index 74% rename from golem_resource_account/wizard/golem_reservation_invoice.xml rename to golem_resource_account/wizard/golem_reservation_invoice_views.xml index a73779b..d2ec5a2 100644 --- a/golem_resource_account/wizard/golem_reservation_invoice.xml +++ b/golem_resource_account/wizard/golem_reservation_invoice_views.xml @@ -18,24 +18,28 @@ along with this program. If not, see . --> + GOLEM Reservation Invoice Wizard Form golem.reservation.invoice.wizard -
-
+