Merge branch 'master' into golem_resource_account

This commit is contained in:
Fabien BOURGEOIS 2018-03-26 17:59:49 +02:00
commit bd7a873b21
14 changed files with 560 additions and 200 deletions

View File

@ -159,7 +159,7 @@ msgstr "Membres de la famille"
#. module: golem_family #. module: golem_family
#: model:ir.ui.view,arch_db:golem_family.golem_family_form #: model:ir.ui.view,arch_db:golem_family.golem_family_form
msgid "Family form" msgid "Family form"
msgstr "Family form" msgstr "Fiche Famille"
#. module: golem_family #. module: golem_family
#: model:ir.ui.view,arch_db:golem_family.golem_family_form #: model:ir.ui.view,arch_db:golem_family.golem_family_form

View File

@ -18,7 +18,7 @@
{ {
'name': 'GOLEM non-profit membership handling', 'name': 'GOLEM non-profit membership handling',
'summary': 'Extends Odoo membership', 'summary': 'Extends Odoo membership',
'version': '10.0.1.1.2', 'version': '10.0.1.1.3',
'category': 'GOLEM', 'category': 'GOLEM',
'author': 'Fabien Bourgeois, Michel Dessenne', 'author': 'Fabien Bourgeois, Michel Dessenne',
'license': 'AGPL-3', 'license': 'AGPL-3',
@ -27,5 +27,5 @@
'depends': ['golem_member', 'account', 'decimal_precision'], 'depends': ['golem_member', 'account', 'decimal_precision'],
'data': ['views/golem_membership_invoice.xml', 'data': ['views/golem_membership_invoice.xml',
'views/golem_member_view.xml', 'views/golem_member_view.xml',
'report/golem_member_card_template.xml'] 'report/golem_member_card_templates.xml']
} }

View File

@ -20,7 +20,7 @@
'name': 'GOLEM non-profit resources', 'name': 'GOLEM non-profit resources',
'summary': 'GOLEM resources management', 'summary': 'GOLEM resources management',
'description': ''' GOLEM resources management ''', 'description': ''' GOLEM resources management ''',
'version': '10.0.1.10.0', 'version': '10.0.1.12.0',
'category': 'GOLEM', 'category': 'GOLEM',
'author': 'Youssef El Ouahby, Fabien Bourgeois', 'author': 'Youssef El Ouahby, Fabien Bourgeois',
'license': 'AGPL-3', 'license': 'AGPL-3',

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-17 08:07+0000\n" "POT-Creation-Date: 2018-03-26 15:36+0000\n"
"PO-Revision-Date: 2018-03-17 08:07+0000\n" "PO-Revision-Date: 2018-03-26 15:36+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -95,6 +95,11 @@ msgstr "Confirmer"
msgid "Confirmed" msgid "Confirmed"
msgstr "Confirmé" 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 #. 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_reservation_rejection_wizard_create_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_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 #. module: golem_resource
#: selection:golem.resource.reservation,state:0 #: selection:golem.resource.reservation,state:0
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Draft" msgid "Draft"
msgstr "Brouillon" msgstr "Brouillon"
@ -320,6 +326,7 @@ msgstr "Rejet"
#. module: golem_resource #. module: golem_resource
#: selection:golem.resource.reservation,state:0 #: selection:golem.resource.reservation,state:0
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Rejected" msgid "Rejected"
msgstr "Rejeté" msgstr "Rejeté"
@ -344,11 +351,6 @@ msgstr "Nombre de réservations"
msgid "Reservation id" msgid "Reservation id"
msgstr "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 #. module: golem_resource
#: model:ir.actions.act_window,name:golem_resource.golem_resource_reservation_action #: 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 #: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_ids
@ -407,6 +409,11 @@ msgstr "Ressources"
msgid "Saturday" msgid "Saturday"
msgstr "Samedi" 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 #. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form #: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form
msgid "Set to draft" msgid "Set to draft"
@ -499,6 +506,7 @@ msgstr "Valider"
#. module: golem_resource #. module: golem_resource
#: selection:golem.resource.reservation,state:0 #: selection:golem.resource.reservation,state:0
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Validated" msgid "Validated"
msgstr "Validé" msgstr "Validé"

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-17 08:07+0000\n" "POT-Creation-Date: 2018-03-26 15:37+0000\n"
"PO-Revision-Date: 2018-03-17 08:07+0000\n" "PO-Revision-Date: 2018-03-26 15:37+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -95,6 +95,11 @@ msgstr ""
msgid "Confirmed" msgid "Confirmed"
msgstr "" 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 #. 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_reservation_rejection_wizard_create_uid
#: model:ir.model.fields,field_description:golem_resource.field_golem_resource_create_uid #: model:ir.model.fields,field_description:golem_resource.field_golem_resource_create_uid
@ -134,6 +139,7 @@ msgstr ""
#. module: golem_resource #. module: golem_resource
#: selection:golem.resource.reservation,state:0 #: selection:golem.resource.reservation,state:0
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Draft" msgid "Draft"
msgstr "" msgstr ""
@ -320,6 +326,7 @@ msgstr ""
#. module: golem_resource #. module: golem_resource
#: selection:golem.resource.reservation,state:0 #: selection:golem.resource.reservation,state:0
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Rejected" msgid "Rejected"
msgstr "" msgstr ""
@ -344,11 +351,6 @@ msgstr ""
msgid "Reservation id" msgid "Reservation id"
msgstr "" 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 #. module: golem_resource
#: model:ir.actions.act_window,name:golem_resource.golem_resource_reservation_action #: 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 #: model:ir.model.fields,field_description:golem_resource.field_golem_resource_reservation_ids
@ -407,6 +409,11 @@ msgstr ""
msgid "Saturday" msgid "Saturday"
msgstr "" msgstr ""
#. module: golem_resource
#: model:ir.ui.menu,name:golem_resource.product_template_menu
msgid "Sellable Products"
msgstr ""
#. module: golem_resource #. module: golem_resource
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form #: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_form
msgid "Set to draft" msgid "Set to draft"
@ -499,6 +506,7 @@ msgstr ""
#. module: golem_resource #. module: golem_resource
#: selection:golem.resource.reservation,state:0 #: selection:golem.resource.reservation,state:0
#: model:ir.ui.view,arch_db:golem_resource.golem_resource_reservation_view_search
msgid "Validated" msgid "Validated"
msgstr "" msgstr ""

View File

@ -70,7 +70,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</header> </header>
<sheet> <sheet>
<group> <group>
<group string="Resource"> <group name="resource" string="Resource">
<field name="id" invisible="1" /> <field name="id" invisible="1" />
<field name="resource_id" options="{'no_create': True}" /> <field name="resource_id" options="{'no_create': True}" />
<field name="resource_avaibility_24_7" readonly="1" /> <field name="resource_avaibility_24_7" readonly="1" />
@ -79,7 +79,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="resource_timetable_ids" readonly="1" <field name="resource_timetable_ids" readonly="1"
attrs="{'invisible': [('resource_avaibility_24_7', '=', True)]}" /> attrs="{'invisible': [('resource_avaibility_24_7', '=', True)]}" />
</group> </group>
<group string="Reservation"> <group name="reservation" string="Reservation">
<group> <group>
<field name="date_start" /> <field name="date_start" />
<field name="date_stop" /> <field name="date_stop" />
@ -113,8 +113,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="user_id" /> <field name="user_id" />
<field name="partner_id" /> <field name="partner_id" />
<field name="state" /> <field name="state" />
<filter name="to_validate" string="Reservation to Validate" <filter name="state_draft" string="Draft"
domain="[('state', '=', 'draft')]" />
<filter name="state_confirmed" string="Confirmed, to Validate"
domain="[('state', '=', 'confirmed')]" /> domain="[('state', '=', 'confirmed')]" />
<filter name="state_validated" string="Validated"
domain="[('state', '=', 'validated')]" />
<filter name="state_rejected" string="Rejected"
domain="[('state', '=', 'rejected')]" />
<filter name="group_state" string="State" <filter name="group_state" string="State"
context="{'group_by': 'state'}" /> context="{'group_by': 'state'}" />
<filter name="group_resource" string="Resource" <filter name="group_resource" string="Resource"

View File

@ -135,6 +135,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<menuitem id="resource_configuration_menu" name="Configuration" <menuitem id="resource_configuration_menu" name="Configuration"
parent="golem_resource_menu" groups="golem_base.group_golem_manager" parent="golem_resource_menu" groups="golem_base.group_golem_manager"
sequence="90" /> sequence="90" />
<menuitem id="product_template_menu" name="Sellable Products"
parent="resource_configuration_menu"
action="product.product_template_action" sequence="20" />
</data> </data>
</odoo> </odoo>

View File

@ -26,8 +26,7 @@
'license': 'AGPL-3', 'license': 'AGPL-3',
'application': True, 'application': True,
'installable': True, 'installable': True,
'depends': ['golem_resource', 'depends': ['golem_resource', 'account'],
'account'], 'data': ['wizard/golem_reservation_invoice_views.xml',
'data': ['views/golem_resource_reservation_views.xml', 'views/golem_resource_reservation_views.xml']
'wizard/golem_reservation_invoice.xml']
} }

View File

@ -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 "<strong>\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"
" </strong>"
msgstr "<strong>\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"
" </strong>"
#. 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"

View File

@ -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 "<strong>\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"
" </strong>"
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 ""

View File

@ -18,101 +18,98 @@
""" GOLEM Resource Reservation Adaptation""" """ GOLEM Resource Reservation Adaptation"""
from odoo import models, fields, api, _ from odoo import models, fields, api, _
from odoo.exceptions import UserError from odoo.exceptions import ValidationError
class GolemResourceReservation(models.Model): class GolemResourceReservation(models.Model):
""" GOLEM Resource Reservation Adaptation """ """ GOLEM Resource Reservation Adaptation """
_inherit = 'golem.resource.reservation' _inherit = 'golem.resource.reservation'
invoice_id = fields.Many2one('account.invoice') resource_product_id = fields.Many2one(related='resource_id.product_tmpl_id')
invoicing_state = fields.Char(compute="_compute_invoicing_state", invoice_line_id = fields.Many2one('account.invoice.line', copy=False)
search='_search_invoicing_state', invoice_line_price_subtotal = fields.Monetary(related='invoice_line_id.price_subtotal')
string="Invoicing Status", invoice_id = fields.Many2one(related='invoice_line_id.invoice_id',
default="None") string='Invoice')
invoice_state = fields.Selection(related='invoice_id.state', store=True,
def _search_invoicing_state(self, operator, value): copy=False)
if value == "None": invoice_amount_total = fields.Monetary(related='invoice_id.amount_total')
reservation = self.env['golem.resource.reservation'].search( currency_id = fields.Many2one(related='invoice_id.currency_id')
[('invoice_id', '=', False)])
return [('id', 'in', reservation.mapped('id'))]
else:
return [('invoice_id.state', operator, value)]
@api.multi @api.multi
@api.depends('invoice_id') def check_before_invoicing(self):
def _compute_invoicing_state(self): """ Checks data coherence before invoicing """
""" Compute invoicing_state """
for reservation in self: for reservation in self:
if reservation.invoice_id: if reservation.state != "validated":
reservation.invoicing_state = reservation.invoice_id.state raise ValidationError(
else: _('The reservation "{}" is not validated, please validate '
reservation.invoicing_state = "None" '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 @api.multi
def open_invoice(self): def create_invoice_line(self, invoice_id):
""" open invoice """ """ Create invoice line corresponding to reservation """
for reservation in self: for reservation in self:
if reservation.invoice_id: product = reservation.resource_id.product_tmpl_id
return {'name' : _('Reservation Invoice'), amount = product.list_price
'type' : 'ir.actions.act_window', account_id = product.property_account_income_id.id or \
'res_model' : 'account.invoice', product.categ_id.property_account_income_categ_id.id
'res_id' : reservation.invoice_id.id, delta = fields.Datetime.from_string(reservation.date_stop) - \
'view_mode': 'form', fields.Datetime.from_string(reservation.date_start)
'view_id': self.env.ref('account.invoice_form').id, quantity = (delta.days * 24) + (delta.seconds/3600.0)
'target': 'current'}
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 @api.multi
def create_invoice(self): def create_invoice(self):
""" Create invoice """ """ Invoice creation """
for reservation in self: for reservation in self:
if reservation.state != "validated": reservation.check_before_invoicing()
raise UserError(
_("The reservation '%s' is not validated, please validate it before \
creating invoice") % reservation.name)
inv_obj = self.env['account.invoice'] inv_obj = self.env['account.invoice']
partner_id = reservation.partner_id 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: invoice_id = inv_obj.create({
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,
'origin': reservation.name, 'origin': reservation.name,
'type': 'out_invoice', 'type': 'out_invoice',
'reference': False, 'reference': False,
'account_id': partner_id.property_account_receivable_id.id, 'account_id': partner_id.property_account_receivable_id.id,
'partner_id': partner_id.id, 'partner_id': partner_id.id
'invoice_line_ids': [(0, 0, { })
'name': reservation.resource_id.name, reservation.create_invoice_line(invoice_id)
#'origin': ,
'account_id': account_id, @api.multi
'price_unit': amount, def show_invoice(self):
'quantity': quantity, """ Redirects to linked invoice """
'discount': 0.0, self.ensure_one()
'uom_id': product.uom_id.id, reservation = self[0]
'product_id': product.id, if reservation.invoice_id:
})], return {'type': 'ir.actions.act_window',
}) 'res_model': 'account.invoice',
reservation.invoice_id = invoice.id 'res_id': reservation.invoice_id.id,
'view_mode': 'form',
'view_id': self.env.ref('account.invoice_form').id}

View File

@ -28,7 +28,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<attribute name="colors">red : invoicing_state=='open'; green : invoicing_state=='paid'; black: state=='draft'; blue : state=='validated'; grey : state=='canceled'; orange : state=='rejected'</attribute> <attribute name="colors">red : invoicing_state=='open'; green : invoicing_state=='paid'; black: state=='draft'; blue : state=='validated'; grey : state=='canceled'; orange : state=='rejected'</attribute>
</xpath> </xpath>
<field name="state" position="after"> <field name="state" position="after">
<field name="invoicing_state"/> <field name="invoice_id" />
<field name="invoice_state" string="Invoice status" />
</field> </field>
</field> </field>
</record> </record>
@ -41,37 +42,51 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name='inherit_id' ref="golem_resource.golem_resource_reservation_view_form"/> <field name='inherit_id' ref="golem_resource.golem_resource_reservation_view_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<button name="state_rejected" position="after"> <button name="state_rejected" position="after">
<button name="create_invoice" type="object" string="Create New Invoice" class="oe_highlight" <button name="create_invoice" type="object" string="Create Invoice" class="oe_highlight"
attrs="{'invisible': ['|', ('state', 'not in', 'validated'), attrs="{'invisible': ['|', ('state', '!=', 'validated'), '|', ('resource_product_id', '=', False), ('invoice_id', '!=', False)]}" />
'|',('id', '=', False), ('invoicing_state', '=', 'paid')]}" /> <button name="show_invoice" type="object" string="Show invoice" class="oe_highlight"
<button name="open_invoice" type="object" string="Open Invoice" class="oe_highlight" attrs="{'invisible': [('invoice_id', '=', False)]}" />
attrs="{'invisible': [('invoicing_state', '==', 'None')]}" />
</button> </button>
<field name="partner_id" position="after"> <group name="reservation" position="after">
<field name="invoicing_state" readonly="1" /> <group name="invoicing" string="Invoicing"
</field> attrs="{'invisible': [('invoice_id', '=', False)]}">
<field name="resource_product_id" />
<field name="invoice_id" />
<field name="invoice_state" />
<field name="invoice_amount_total" />
<field name="invoice_line_id" />
<field name="invoice_line_price_subtotal" />
</group>
</group>
</field> </field>
</record> </record>
<!-- Searches --> <!-- Searches -->
<record model="ir.ui.view" <record model="ir.ui.view"
id="golem_resource_reservation_search_inherit_golem_resource_account"> id="golem_resource_reservation_search_inherit_golem_resource_account">
<field name="name">GOLEM Resource Reservation Search Adaptations to invoicing</field> <field name="name"> GOLEM Resource Reservation Search Adaptations</field>
<field name="model">golem.resource.reservation</field> <field name="model">golem.resource.reservation</field>
<field name="inherit_id" ref="golem_resource.golem_resource_reservation_view_search"/> <field name='inherit_id'
ref="golem_resource.golem_resource_reservation_view_search"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<search position="inside"> <field name="state" position="after">
<filter name="to_invoice" string="Reservation To Invoice" <field name="invoice_id" string="Invoice"
domain="[('invoicing_state', '=', 'None')]" /> filter_domain="[('invoice_id.number', 'ilike', self)]" />
<filter name="invoice_draft" string="Invoice Draft" </field>
domain="[('invoicing_state', '=', 'draft')]" /> <filter name="state_rejected" position="after">
<filter name="invoice_open" string="Invoice Open" <separator />
domain="[('invoicing_state', '=', 'open')]" /> <filter name="invoiced" string="Invoiced"
<filter name="invoice_paid" string="Invoice Paid" domain="[('invoice_line_id', '!=', False)]" />
domain="[('invoicing_state', '=', 'paid')]" /> <filter name="not_invoiced" string="Not invoiced"
</search> domain="[('state', '=', 'validated'), ('invoice_line_id', '=', False)]" />
</filter>
<filter name="group_state" position="after">
<filter name="group_invoice_state" string="Invoice state"
context="{'group_by': 'invoice_state'}" />
</filter>
</field> </field>
</record>--> </record>
<!-- Add option to the "More" button --> <!-- Add option to the "More" button -->
<act_window id="action_golem_reservation_invoice_wizard" <act_window id="action_golem_reservation_invoice_wizard"
name="Reservations to invoice" name="Reservations to invoice"
@ -79,7 +94,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
src_model="golem.resource.reservation" src_model="golem.resource.reservation"
view_mode="form" view_mode="form"
multi="True" multi="True"
target="new" target="new" />
/>
</data> </data>
</odoo> </odoo>

View File

@ -18,86 +18,28 @@
""" GOLEM Reservation Invoice Wizard""" """ GOLEM Reservation Invoice Wizard"""
from odoo import models, fields, api, _ from odoo import models, fields, api
from odoo.exceptions import ValidationError, UserError
class GolemReservationInvoiceWizard(models.TransientModel): class GolemReservationInvoiceWizard(models.TransientModel):
""" GOLEM Resource Reservation Invoice Wizard """ """ GOLEM Resource Reservation Invoice Wizard """
_name = 'golem.reservation.invoice.wizard' _name = 'golem.reservation.invoice.wizard'
reservation_ids = fields.Many2many('golem.resource.reservation', reservation_ids = fields.Many2many(
default=lambda self: self._context.get('active_ids', []), 'golem.resource.reservation', required=True, string='Reservations to invoice',
string='Reservations to invoice') default=lambda self: self._context.get('active_ids', []))
@api.multi @api.multi
def create_invoices(self): def create_invoice(self):
""" Create invoices for reservation """ """ Invoice creation """
self.ensure_one() self.ensure_one()
if self.reservation_ids:
inv_obj = self.env['account.invoice'] self.reservation_ids.check_before_invoicing()
partner_id = self.reservation_ids[0].partner_id self.reservation_ids[0].create_invoice()
product = self.reservation_ids[0].resource_id.product_tmpl_id 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: if self._context.get('open_invoice', False):
account_id = product.property_account_income_id.id return self.reservation_ids[0].show_invoice()
if not account_id: return {'type': 'ir.actions.act_window_close'}
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'}

View File

@ -18,24 +18,28 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
--> -->
<odoo> <odoo>
<data> <data>
<!-- Forms --> <!-- Forms -->
<record model="ir.ui.view" <record model="ir.ui.view"
id="golem_reservation_invoice_wizard_form"> id="golem_reservation_invoice_wizard_form">
<field name="name"> GOLEM Reservation Invoice Wizard Form</field> <field name="name"> GOLEM Reservation Invoice Wizard Form</field>
<field name="model">golem.reservation.invoice.wizard</field> <field name="model">golem.reservation.invoice.wizard</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Reservation to invoice"> <form string="Reservations to invoice">
<label string="Invoices will be created in draft so that you can review them before validation" /> <p>
<field name="reservation_ids" /> <strong>
Only one invoice will be created in draft with corresponding reservations.
Then, you will be redirected to the new invoice and can review it before validation.
</strong>
</p>
<footer> <footer>
<button name="create_invoices" string="Create and View Invoices" type="object" <button name="create_invoice" string="Create Invoice" type="object"
context="{'open_invoices': True}" class="oe_highlight" />
<button name="create_invoices" string="Create Invoices" type="object"
class="oe_highlight" /> class="oe_highlight" />
<button string="Cancel" class="oe_link" special="cancel" /> <button string="Cancel" class="oe_link" special="cancel" />
</footer> </footer>
</form> </form>
</field> </field>
</record> </record>
</data> </data>
</odoo> </odoo>