From 82d0df92b40e1f14017fdf403793c43a479a94ec Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Sun, 18 Mar 2018 10:32:48 +0100 Subject: [PATCH 01/25] [TYPO][i18n]On GOLEM Family (form) --- golem_family/i18n/fr.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From e02b9b052badf2013dc52d25858b05074b0ed0cd Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 26 Mar 2018 10:38:54 +0200 Subject: [PATCH 02/25] [FIX]GOLEM Membership : bad XML path for card template --- golem_membership/__manifest__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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'] } From b745669e40e23d2f126bc1e01e4af1c07a1d6562 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 26 Mar 2018 10:57:10 +0200 Subject: [PATCH 03/25] [FIX]GOLEM Resource Account : bad order for data, views needs wizard XMLID, not found at install --- golem_resource_account/__manifest__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/golem_resource_account/__manifest__.py b/golem_resource_account/__manifest__.py index 7451bd4..5296b87 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.xml', + 'views/golem_resource_reservation_views.xml'] } From 1957dd8ca27fec77a81278306e3ddd932bca4fe5 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 26 Mar 2018 11:01:34 +0200 Subject: [PATCH 04/25] [QUA]Bascic quality enhancements --- .../models/golem_resource_reservation.py | 6 ++++-- .../wizard/golem_reservation_invoice.py | 8 +++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/golem_resource_account/models/golem_resource_reservation.py b/golem_resource_account/models/golem_resource_reservation.py index 0b774a7..9f054e2 100644 --- a/golem_resource_account/models/golem_resource_reservation.py +++ b/golem_resource_account/models/golem_resource_reservation.py @@ -20,7 +20,7 @@ from odoo import models, fields, api, _ -from odoo.exceptions import ValidationError, UserError +from odoo.exceptions import UserError class GolemResourceReservation(models.Model): @@ -28,11 +28,13 @@ class GolemResourceReservation(models.Model): _inherit = 'golem.resource.reservation' invoice_id = fields.Many2one('account.invoice') - invoicing_state = fields.Selection(related="invoice_id.state", string="Invoicing Status", default="None") + invoicing_state = fields.Selection(related="invoice_id.state", + string="Invoicing Status", default="None") @api.multi def create_invoice(self): + """ Invoice creation """ for reservation in self: inv_obj = self.env['account.invoice'] partner_id = reservation.partner_id diff --git a/golem_resource_account/wizard/golem_reservation_invoice.py b/golem_resource_account/wizard/golem_reservation_invoice.py index 51269eb..5980a80 100644 --- a/golem_resource_account/wizard/golem_reservation_invoice.py +++ b/golem_resource_account/wizard/golem_reservation_invoice.py @@ -19,7 +19,7 @@ """ GOLEM Reservation Invoice Wizard""" from odoo import models, fields, api, _ -from odoo.exceptions import ValidationError, UserError +from odoo.exceptions import UserError class GolemReservationInvoiceWizard(models.TransientModel): @@ -30,11 +30,9 @@ class GolemReservationInvoiceWizard(models.TransientModel): default=lambda self: self._context.get('active_ids', []), string='Reservations to invoice') - - - @api.multi def create_invoices(self): + """ Invoice creations """ self.ensure_one() if self.reservation_ids: @@ -68,7 +66,7 @@ class GolemReservationInvoiceWizard(models.TransientModel): 'product_id': product.id, })) invoice = inv_obj.create({ - 'name': reservation.name, + 'name': self.reservation_ids[-1].name, #'origin': self.application_number, 'type': 'out_invoice', 'reference': False, From ba7ab0208424a3d857e5bef9633d8f0a0b431f45 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 26 Mar 2018 11:11:16 +0200 Subject: [PATCH 05/25] [IMP]GOLEM Resource Account : do not allow invoice creation without product, improve creation algorithm --- .../models/golem_resource_reservation.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/golem_resource_account/models/golem_resource_reservation.py b/golem_resource_account/models/golem_resource_reservation.py index 9f054e2..73132be 100644 --- a/golem_resource_account/models/golem_resource_reservation.py +++ b/golem_resource_account/models/golem_resource_reservation.py @@ -20,7 +20,7 @@ from odoo import models, fields, api, _ -from odoo.exceptions import UserError +from odoo.exceptions import ValidationError class GolemResourceReservation(models.Model): @@ -41,19 +41,19 @@ class GolemResourceReservation(models.Model): product = reservation.resource_id.product_tmpl_id amount = product.standard_price - if product.id: - account_id = product.property_account_income_id.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: - account_id = product.categ_id.property_account_income_categ_id.id - - if not account_id: - raise UserError( + raise ValidationError( _('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,)) - reservation.invoice_id = inv_obj.create({ 'name': reservation.name, #'origin': self.application_number, From 476c1b25b848964fbfe0ce6d9932f538dfe8d2f0 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 26 Mar 2018 11:22:36 +0200 Subject: [PATCH 06/25] [FIX]GOLEM Resource Account : better to use default name for invoice and use reservation name as origin --- .../models/golem_resource_reservation.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/golem_resource_account/models/golem_resource_reservation.py b/golem_resource_account/models/golem_resource_reservation.py index 73132be..a245238 100644 --- a/golem_resource_account/models/golem_resource_reservation.py +++ b/golem_resource_account/models/golem_resource_reservation.py @@ -50,25 +50,23 @@ class GolemResourceReservation(models.Model): if not account_id: raise ValidationError( - _('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,)) + _('There is no income account defined for this product: "{}"' + '. You have to configure it on the product form.'.format(product.name))) reservation.invoice_id = inv_obj.create({ - 'name': reservation.name, - #'origin': self.application_number, + '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': , + 'origin': reservation.name, 'account_id': account_id, 'price_unit': amount, 'quantity': 1.0, 'discount': 0.0, 'uom_id': product.uom_id.id, 'product_id': product.id, - })], + })] }) From 64607e5758fc104efb510f1b686adf3f6f2fee5f Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 26 Mar 2018 11:37:31 +0200 Subject: [PATCH 07/25] [IMP]GOLEM Resource Account : do not show create invoicde button when there is no linked product --- golem_resource_account/models/golem_resource_reservation.py | 1 + .../views/golem_resource_reservation_views.xml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/golem_resource_account/models/golem_resource_reservation.py b/golem_resource_account/models/golem_resource_reservation.py index a245238..43fec4e 100644 --- a/golem_resource_account/models/golem_resource_reservation.py +++ b/golem_resource_account/models/golem_resource_reservation.py @@ -27,6 +27,7 @@ class GolemResourceReservation(models.Model): """ GOLEM Resource Reservation Adaptation """ _inherit = 'golem.resource.reservation' + resource_product_id = fields.Many2one(related='resource_id.product_tmpl_id') invoice_id = fields.Many2one('account.invoice') invoicing_state = fields.Selection(related="invoice_id.state", string="Invoicing Status", default="None") diff --git a/golem_resource_account/views/golem_resource_reservation_views.xml b/golem_resource_account/views/golem_resource_reservation_views.xml index 8741857..3d5e3ca 100644 --- a/golem_resource_account/views/golem_resource_reservation_views.xml +++ b/golem_resource_account/views/golem_resource_reservation_views.xml @@ -41,8 +41,9 @@ along with this program. If not, see . From 942975e187b6b22a7fe11e1b397205a75a3b37bf Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 26 Mar 2018 12:01:50 +0200 Subject: [PATCH 08/25] [TYPO]GOLEM Resource : name form groups --- golem_resource/__manifest__.py | 2 +- golem_resource/views/golem_resource_reservation_views.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/golem_resource/__manifest__.py b/golem_resource/__manifest__.py index 7fec3ab..91cc5fc 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.10.1', 'category': 'GOLEM', 'author': 'Youssef El Ouahby, Fabien Bourgeois', 'license': 'AGPL-3', diff --git a/golem_resource/views/golem_resource_reservation_views.xml b/golem_resource/views/golem_resource_reservation_views.xml index 03c2063..3092578 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 . - + From 4fc04548a6590e1983841b3b305013dd49e78260 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 26 Mar 2018 12:02:41 +0200 Subject: [PATCH 09/25] [IMP]GOLEM Resource Accont : add invoicing information on form, add search options --- .../models/golem_resource_reservation.py | 10 ++-- .../golem_resource_reservation_views.xml | 54 +++++++++---------- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/golem_resource_account/models/golem_resource_reservation.py b/golem_resource_account/models/golem_resource_reservation.py index 43fec4e..011d248 100644 --- a/golem_resource_account/models/golem_resource_reservation.py +++ b/golem_resource_account/models/golem_resource_reservation.py @@ -28,10 +28,12 @@ class GolemResourceReservation(models.Model): _inherit = 'golem.resource.reservation' resource_product_id = fields.Many2one(related='resource_id.product_tmpl_id') - invoice_id = fields.Many2one('account.invoice') - invoicing_state = fields.Selection(related="invoice_id.state", - string="Invoicing Status", default="None") - + invoice_id = fields.Many2one('account.invoice', 'Invoice', index=True) + invoice_state = fields.Selection(related='invoice_id.state', store=True) + invoice_amount_total = fields.Monetary(related='invoice_id.amount_total') + invoice_line_id = fields.Many2one('account.invoice.line') + invoice_line_price_subtotal = fields.Monetary(related='invoice_line_id.price_subtotal') + currency_id = fields.Many2one(related='invoice_id.currency_id') @api.multi def create_invoice(self): diff --git a/golem_resource_account/views/golem_resource_reservation_views.xml b/golem_resource_account/views/golem_resource_reservation_views.xml index 3d5e3ca..37cc902 100644 --- a/golem_resource_account/views/golem_resource_reservation_views.xml +++ b/golem_resource_account/views/golem_resource_reservation_views.xml @@ -28,7 +28,7 @@ along with this program. If not, see . - + @@ -41,44 +41,40 @@ along with this program. If not, see . + + + + + + + + + - + + Date: Mon, 26 Mar 2018 12:33:41 +0200 Subject: [PATCH 10/25] [FIX]GOLEM Resource Account : use list, not standard price --- golem_resource_account/models/golem_resource_reservation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/golem_resource_account/models/golem_resource_reservation.py b/golem_resource_account/models/golem_resource_reservation.py index 011d248..2af1e32 100644 --- a/golem_resource_account/models/golem_resource_reservation.py +++ b/golem_resource_account/models/golem_resource_reservation.py @@ -42,7 +42,7 @@ class GolemResourceReservation(models.Model): inv_obj = self.env['account.invoice'] partner_id = reservation.partner_id product = reservation.resource_id.product_tmpl_id - amount = product.standard_price + amount = product.list_price if not product: raise ValidationError(_('You can not create an invoice without ' From 5307ae37c064464fc9d1ba2fe30757f33c0a053d Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 26 Mar 2018 12:35:12 +0200 Subject: [PATCH 11/25] [IMP]GOLEM Resource Account : linked to account line, computes account_id from line, improve search and attrs on form --- .../models/golem_resource_reservation.py | 7 ++++--- .../views/golem_resource_reservation_views.xml | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/golem_resource_account/models/golem_resource_reservation.py b/golem_resource_account/models/golem_resource_reservation.py index 2af1e32..cfa2b0d 100644 --- a/golem_resource_account/models/golem_resource_reservation.py +++ b/golem_resource_account/models/golem_resource_reservation.py @@ -28,11 +28,12 @@ class GolemResourceReservation(models.Model): _inherit = 'golem.resource.reservation' resource_product_id = fields.Many2one(related='resource_id.product_tmpl_id') - invoice_id = fields.Many2one('account.invoice', 'Invoice', index=True) - invoice_state = fields.Selection(related='invoice_id.state', store=True) - invoice_amount_total = fields.Monetary(related='invoice_id.amount_total') invoice_line_id = fields.Many2one('account.invoice.line') 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) + invoice_amount_total = fields.Monetary(related='invoice_id.amount_total') currency_id = fields.Many2one(related='invoice_id.currency_id') @api.multi diff --git a/golem_resource_account/views/golem_resource_reservation_views.xml b/golem_resource_account/views/golem_resource_reservation_views.xml index 37cc902..00590f1 100644 --- a/golem_resource_account/views/golem_resource_reservation_views.xml +++ b/golem_resource_account/views/golem_resource_reservation_views.xml @@ -47,6 +47,7 @@ along with this program. If not, see . + attrs="{'invisible': [('invoice_id', '=', False)]}"> @@ -66,7 +67,8 @@ along with this program. If not, see . ref="golem_resource.golem_resource_reservation_view_search"/> - + Date: Mon, 26 Mar 2018 12:36:17 +0200 Subject: [PATCH 12/25] [FIX]GOLEM Resource Account : do not allow invoice re-creation --- .../models/golem_resource_reservation.py | 11 +++++++---- .../views/golem_resource_reservation_views.xml | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/golem_resource_account/models/golem_resource_reservation.py b/golem_resource_account/models/golem_resource_reservation.py index cfa2b0d..e5209db 100644 --- a/golem_resource_account/models/golem_resource_reservation.py +++ b/golem_resource_account/models/golem_resource_reservation.py @@ -40,6 +40,9 @@ class GolemResourceReservation(models.Model): def create_invoice(self): """ Invoice creation """ for reservation in self: + if reservation.invoice_line_id: + raise ValidationError(_('You can not create an invoice as there ' + 'is already one.')) inv_obj = self.env['account.invoice'] partner_id = reservation.partner_id product = reservation.resource_id.product_tmpl_id @@ -66,11 +69,11 @@ class GolemResourceReservation(models.Model): 'invoice_line_ids': [(0, 0, { 'name': reservation.resource_id.name, 'origin': reservation.name, - 'account_id': account_id, 'price_unit': amount, 'quantity': 1.0, - 'discount': 0.0, 'uom_id': product.uom_id.id, + 'account_id': account_id, 'product_id': product.id, - })] - }) + })] + }) + reservation.invoice_line_id = reservation.invoice_id.invoice_line_ids[0] diff --git a/golem_resource_account/views/golem_resource_reservation_views.xml b/golem_resource_account/views/golem_resource_reservation_views.xml index 00590f1..f25975b 100644 --- a/golem_resource_account/views/golem_resource_reservation_views.xml +++ b/golem_resource_account/views/golem_resource_reservation_views.xml @@ -28,6 +28,7 @@ along with this program. If not, see . + @@ -42,11 +43,10 @@ along with this program. If not, see . attrs="{'invisible': [('invoice_id', '=', False)]}"> From abcdcb1748e824fc7108d1487fe49e70ab517b31 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 26 Mar 2018 12:36:42 +0200 Subject: [PATCH 13/25] [IMP]GOLEM Resource Account : add header button to go to invoice directly --- .../models/golem_resource_reservation.py | 12 ++++++++++++ .../views/golem_resource_reservation_views.xml | 2 ++ 2 files changed, 14 insertions(+) diff --git a/golem_resource_account/models/golem_resource_reservation.py b/golem_resource_account/models/golem_resource_reservation.py index e5209db..dba0767 100644 --- a/golem_resource_account/models/golem_resource_reservation.py +++ b/golem_resource_account/models/golem_resource_reservation.py @@ -77,3 +77,15 @@ class GolemResourceReservation(models.Model): })] }) reservation.invoice_line_id = reservation.invoice_id.invoice_line_ids[0] + + @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 f25975b..a59e5ab 100644 --- a/golem_resource_account/views/golem_resource_reservation_views.xml +++ b/golem_resource_account/views/golem_resource_reservation_views.xml @@ -44,6 +44,8 @@ along with this program. If not, see . Date: Mon, 26 Mar 2018 16:13:47 +0200 Subject: [PATCH 14/25] [IMP]GOLEM Resource : add more direct filters based on states --- golem_resource/__manifest__.py | 2 +- golem_resource/views/golem_resource_reservation_views.xml | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/golem_resource/__manifest__.py b/golem_resource/__manifest__.py index 91cc5fc..640123a 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.1', + 'version': '10.0.1.11.0', 'category': 'GOLEM', 'author': 'Youssef El Ouahby, Fabien Bourgeois', 'license': 'AGPL-3', diff --git a/golem_resource/views/golem_resource_reservation_views.xml b/golem_resource/views/golem_resource_reservation_views.xml index 3092578..0eb7b04 100644 --- a/golem_resource/views/golem_resource_reservation_views.xml +++ b/golem_resource/views/golem_resource_reservation_views.xml @@ -113,8 +113,14 @@ along with this program. If not, see . - + + + Date: Mon, 26 Mar 2018 16:14:13 +0200 Subject: [PATCH 15/25] [IMP]GOLEM Resource Account : direct filters invoiced or not --- .../views/golem_resource_reservation_views.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/golem_resource_account/views/golem_resource_reservation_views.xml b/golem_resource_account/views/golem_resource_reservation_views.xml index a59e5ab..3ec24a9 100644 --- a/golem_resource_account/views/golem_resource_reservation_views.xml +++ b/golem_resource_account/views/golem_resource_reservation_views.xml @@ -72,6 +72,13 @@ along with this program. If not, see . + + + + + From a5c51123f34c8cba044c50cd95563e569f3ba008 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 26 Mar 2018 16:16:51 +0200 Subject: [PATCH 16/25] [IMP]GOLEM Resource Account : add invoice state on form --- .../views/golem_resource_reservation_views.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/golem_resource_account/views/golem_resource_reservation_views.xml b/golem_resource_account/views/golem_resource_reservation_views.xml index 3ec24a9..acf7021 100644 --- a/golem_resource_account/views/golem_resource_reservation_views.xml +++ b/golem_resource_account/views/golem_resource_reservation_views.xml @@ -52,6 +52,7 @@ along with this program. If not, see . attrs="{'invisible': [('invoice_id', '=', False)]}"> + From 9b25450a4a6118bab2b17ec411762dad4a8e2407 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 26 Mar 2018 16:22:57 +0200 Subject: [PATCH 17/25] [MOV][QUA]Pure quality / renaming --- golem_resource_account/__manifest__.py | 2 +- .../golem_resource_reservation_views.xml | 29 +++---- .../wizard/golem_reservation_invoice.py | 79 +++++++++---------- ...ml => golem_reservation_invoice_views.xml} | 29 ++----- 4 files changed, 55 insertions(+), 84 deletions(-) rename golem_resource_account/wizard/{golem_reservation_invoice.xml => golem_reservation_invoice_views.xml} (72%) diff --git a/golem_resource_account/__manifest__.py b/golem_resource_account/__manifest__.py index 5296b87..2ebd21b 100644 --- a/golem_resource_account/__manifest__.py +++ b/golem_resource_account/__manifest__.py @@ -27,6 +27,6 @@ 'application': True, 'installable': True, 'depends': ['golem_resource', 'account'], - 'data': ['wizard/golem_reservation_invoice.xml', + 'data': ['wizard/golem_reservation_invoice_views.xml', 'views/golem_resource_reservation_views.xml'] } diff --git a/golem_resource_account/views/golem_resource_reservation_views.xml b/golem_resource_account/views/golem_resource_reservation_views.xml index acf7021..dd83272 100644 --- a/golem_resource_account/views/golem_resource_reservation_views.xml +++ b/golem_resource_account/views/golem_resource_reservation_views.xml @@ -95,26 +95,15 @@ along with this program. If not, see . view_mode="form" view_id="golem_reservation_invoice_wizard_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 5980a80..056a623 100644 --- a/golem_resource_account/wizard/golem_reservation_invoice.py +++ b/golem_resource_account/wizard/golem_reservation_invoice.py @@ -26,52 +26,51 @@ 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): """ Invoice creations """ 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 + inv_obj = self.env['account.invoice'] + partner_id = self.reservation_ids[0].partner_id + product = self.reservation_ids[0].resource_id.product_tmpl_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,)) + 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 = [] + lines = [] - for reservation in self.reservation_ids: - product = reservation.resource_id.product_tmpl_id - amount = product.standard_price - lines.append((0, 0, { - 'name': reservation.resource_id.name, - #'origin': , - 'account_id': account_id, - 'price_unit': amount, - 'quantity': 1.0, - 'discount': 0.0, - 'uom_id': product.uom_id.id, - 'product_id': product.id, - })) - invoice = inv_obj.create({ - 'name': self.reservation_ids[-1].name, - #'origin': self.application_number, - '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}) + for reservation in self.reservation_ids: + product = reservation.resource_id.product_tmpl_id + amount = product.standard_price + lines.append((0, 0, { + 'name': reservation.resource_id.name, + #'origin': , + 'account_id': account_id, + 'price_unit': amount, + 'quantity': 1.0, + 'discount': 0.0, + 'uom_id': product.uom_id.id, + 'product_id': product.id, + })) + invoice = inv_obj.create({ + 'name': self.reservation_ids[-1].name, + #'origin': self.application_number, + '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}) diff --git a/golem_resource_account/wizard/golem_reservation_invoice.xml b/golem_resource_account/wizard/golem_reservation_invoice_views.xml similarity index 72% rename from golem_resource_account/wizard/golem_reservation_invoice.xml rename to golem_resource_account/wizard/golem_reservation_invoice_views.xml index 2b724a0..caa74e9 100644 --- a/golem_resource_account/wizard/golem_reservation_invoice.xml +++ b/golem_resource_account/wizard/golem_reservation_invoice_views.xml @@ -19,24 +19,6 @@ along with this program. If not, see . - - - - - @@ -45,7 +27,7 @@ along with this program. If not, see .
- +
-
-
-
- GOLEM Reservation Invoice Wizard Form From 2336614701766b54c38f0b4fd2252bab9605b9d7 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 26 Mar 2018 17:08:03 +0200 Subject: [PATCH 20/25] [REF]GOLEM Resource Account : separate check, create invoice and create invoice line actions --- .../models/golem_resource_reservation.py | 52 ++++++++++++------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/golem_resource_account/models/golem_resource_reservation.py b/golem_resource_account/models/golem_resource_reservation.py index dba0767..0b4492b 100644 --- a/golem_resource_account/models/golem_resource_reservation.py +++ b/golem_resource_account/models/golem_resource_reservation.py @@ -18,7 +18,6 @@ """ GOLEM Resource Reservation Adaptation""" - from odoo import models, fields, api, _ from odoo.exceptions import ValidationError @@ -37,16 +36,13 @@ class GolemResourceReservation(models.Model): currency_id = fields.Many2one(related='invoice_id.currency_id') @api.multi - def create_invoice(self): - """ Invoice creation """ + def check_before_invoicing(self): + """ Checks data coherence before invoicing """ for reservation in self: if reservation.invoice_line_id: raise ValidationError(_('You can not create an invoice as there ' 'is already one.')) - inv_obj = self.env['account.invoice'] - partner_id = reservation.partner_id product = reservation.resource_id.product_tmpl_id - amount = product.list_price if not product: raise ValidationError(_('You can not create an invoice without ' @@ -60,23 +56,43 @@ class GolemResourceReservation(models.Model): _('There is no income account defined for this product: "{}"' '. You have to configure it on the product form.'.format(product.name))) - reservation.invoice_id = inv_obj.create({ + @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 + + line_id = self.env['account.invoice.line'].create({ + 'invoice_id': invoice_id.id, + 'name': product.name, + 'origin': reservation.name, + 'price_unit': amount, + 'quantity': 1.0, + '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): + """ 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, - 'invoice_line_ids': [(0, 0, { - 'name': reservation.resource_id.name, - 'origin': reservation.name, - 'price_unit': amount, - 'quantity': 1.0, - 'uom_id': product.uom_id.id, - 'account_id': account_id, - 'product_id': product.id, - })] + 'partner_id': partner_id.id }) - reservation.invoice_line_id = reservation.invoice_id.invoice_line_ids[0] + reservation.create_invoice_line(invoice_id) @api.multi def show_invoice(self): From f25e69040a41f4680016cec81180de534a2ea33b Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 26 Mar 2018 17:09:23 +0200 Subject: [PATCH 21/25] [REF][FIX][IMP]GOLEM Resource Account : create only one invoice, use actions on main model and add as many lines as needed on invoice --- .../wizard/golem_reservation_invoice.py | 45 ++++--------------- .../golem_reservation_invoice_views.xml | 7 +-- 2 files changed, 12 insertions(+), 40 deletions(-) diff --git a/golem_resource_account/wizard/golem_reservation_invoice.py b/golem_resource_account/wizard/golem_reservation_invoice.py index ec8e57d..16d63c9 100644 --- a/golem_resource_account/wizard/golem_reservation_invoice.py +++ b/golem_resource_account/wizard/golem_reservation_invoice.py @@ -31,43 +31,14 @@ class GolemReservationInvoiceWizard(models.TransientModel): default=lambda self: self._context.get('active_ids', [])) @api.multi - def create_invoices(self): - """ Invoice creations """ + def create_invoice(self): + """ Invoice creation """ self.ensure_one() - 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() + if len(self.reservation_ids) > 1: + invoice_id = self.reservation_ids[0].invoice_id + 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: - product = reservation.resource_id.product_tmpl_id - amount = product.standard_price - lines.append((0, 0, { - 'origin': reservation.resource_id.name, - 'account_id': account_id, - 'price_unit': amount, - 'quantity': 1.0, - 'uom_id': product.uom_id.id, - 'product_id': product.id, - })) - invoice = inv_obj.create({ - 'origin': self.reservation_ids[-1].name, - '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}) + # return {} diff --git a/golem_resource_account/wizard/golem_reservation_invoice_views.xml b/golem_resource_account/wizard/golem_reservation_invoice_views.xml index 6016fab..d2ec5a2 100644 --- a/golem_resource_account/wizard/golem_reservation_invoice_views.xml +++ b/golem_resource_account/wizard/golem_reservation_invoice_views.xml @@ -25,14 +25,15 @@ along with this program. If not, see . GOLEM Reservation Invoice Wizard Form golem.reservation.invoice.wizard -
+

- Invoices will be created in draft so that you can review them before validation + 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.

-
From 89050d892088d2368dc9f4e7a7ed75dd750a7831 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 26 Mar 2018 17:20:53 +0200 Subject: [PATCH 22/25] [FIX]GOLEM Resource Accout : do not copy invoice line --- golem_resource_account/models/golem_resource_reservation.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/golem_resource_account/models/golem_resource_reservation.py b/golem_resource_account/models/golem_resource_reservation.py index 0b4492b..556100b 100644 --- a/golem_resource_account/models/golem_resource_reservation.py +++ b/golem_resource_account/models/golem_resource_reservation.py @@ -27,11 +27,12 @@ class GolemResourceReservation(models.Model): _inherit = 'golem.resource.reservation' resource_product_id = fields.Many2one(related='resource_id.product_tmpl_id') - invoice_line_id = fields.Many2one('account.invoice.line') + 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) + 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') From 55f8818b9fdf37f41cf9c0331d453900dcd1b337 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 26 Mar 2018 17:21:21 +0200 Subject: [PATCH 23/25] [IMP]GOLEM Resource Account : redirect to new invoice after wizard --- golem_resource_account/wizard/golem_reservation_invoice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/golem_resource_account/wizard/golem_reservation_invoice.py b/golem_resource_account/wizard/golem_reservation_invoice.py index 16d63c9..df9abd5 100644 --- a/golem_resource_account/wizard/golem_reservation_invoice.py +++ b/golem_resource_account/wizard/golem_reservation_invoice.py @@ -37,8 +37,8 @@ class GolemReservationInvoiceWizard(models.TransientModel): 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: - invoice_id = self.reservation_ids[0].invoice_id self.reservation_ids[1:].create_invoice_line(invoice_id) - # return {} + return self.reservation_ids[0].show_invoice() From a476e7ec040eeb70d11f5a84c498858562fa9750 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 26 Mar 2018 17:21:36 +0200 Subject: [PATCH 24/25] [I18N]GOLEM Resource Account : base i18n files --- golem_resource_account/i18n/fr.po | 192 ++++++++++++++++++ .../i18n/golem_resource_account.pot | 186 +++++++++++++++++ 2 files changed, 378 insertions(+) create mode 100644 golem_resource_account/i18n/fr.po create mode 100644 golem_resource_account/i18n/golem_resource_account.pot 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 "" + From d7772228c638e0dd15e695d967c779bdfc1b6526 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 26 Mar 2018 17:38:53 +0200 Subject: [PATCH 25/25] [IMP]GOLEM Resource : basic products menu on configuration --- golem_resource/__manifest__.py | 2 +- golem_resource/i18n/fr.po | 22 +++++++++++++------ golem_resource/i18n/golem_resource.pot | 22 +++++++++++++------ golem_resource/views/golem_resource_views.xml | 3 +++ 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/golem_resource/__manifest__.py b/golem_resource/__manifest__.py index 640123a..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.11.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_views.xml b/golem_resource/views/golem_resource_views.xml index 7fb2a25..9120e28 100644 --- a/golem_resource/views/golem_resource_views.xml +++ b/golem_resource/views/golem_resource_views.xml @@ -135,6 +135,9 @@ along with this program. If not, see . +