From c3f7ee1bb434f94dc4f8b7672bf18b94795b6735 Mon Sep 17 00:00:00 2001 From: eloyoussef Date: Fri, 16 Mar 2018 16:04:33 +0100 Subject: [PATCH] Ajout du Facturation multi ligne depuis action --- golem_resource_account/__init__.py | 2 +- golem_resource_account/__manifest__.py | 5 +- .../models/golem_resource_reservation.py | 5 +- .../golem_resource_reservation_views.xml | 19 +++++ golem_resource_account/wizard/__init__.py | 20 +++++ .../wizard/golem_reservation_invoice.py | 78 ++++++++++++++++++ .../wizard/golem_reservation_invoice.xml | 79 +++++++++++++++++++ 7 files changed, 204 insertions(+), 4 deletions(-) create mode 100644 golem_resource_account/wizard/__init__.py create mode 100644 golem_resource_account/wizard/golem_reservation_invoice.py create mode 100644 golem_resource_account/wizard/golem_reservation_invoice.xml diff --git a/golem_resource_account/__init__.py b/golem_resource_account/__init__.py index 1fced20..f95e908 100644 --- a/golem_resource_account/__init__.py +++ b/golem_resource_account/__init__.py @@ -16,4 +16,4 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from . import models +from . import models, wizard diff --git a/golem_resource_account/__manifest__.py b/golem_resource_account/__manifest__.py index d35b402..7451bd4 100644 --- a/golem_resource_account/__manifest__.py +++ b/golem_resource_account/__manifest__.py @@ -20,7 +20,7 @@ 'name': 'GOLEM resources invoicing', 'summary': 'GOLEM resources invoicing', 'description': ''' GOLEM resources invoicing ''', - 'version': '10.0.0.0.0', + 'version': '10.0.0.0.2', 'category': 'GOLEM', 'author': 'Youssef El Ouahby, Fabien Bourgeois', 'license': 'AGPL-3', @@ -28,5 +28,6 @@ 'installable': True, 'depends': ['golem_resource', 'account'], - 'data': ['views/golem_resource_reservation_views.xml'] + 'data': ['views/golem_resource_reservation_views.xml', + 'wizard/golem_reservation_invoice.xml'] } diff --git a/golem_resource_account/models/golem_resource_reservation.py b/golem_resource_account/models/golem_resource_reservation.py index 848b99b..ca8baa5 100644 --- a/golem_resource_account/models/golem_resource_reservation.py +++ b/golem_resource_account/models/golem_resource_reservation.py @@ -27,7 +27,7 @@ class GolemResourceReservation(models.Model): """ GOLEM Resource Reservation Adaptation """ _inherit = 'golem.resource.reservation' - + @api.multi def create_invoice(self): for reservation in self: @@ -38,13 +38,16 @@ class GolemResourceReservation(models.Model): if product.id: account_id = product.property_account_income_id.id + if not account_id: account_id = product.categ_id.property_account_income_categ_id.id + if not account_id: raise UserError( _('There is no income account defined for this product: "%s". \ You may have to install a chart of account from Accounting \ app, settings menu.') % (product.name,)) + invoice = inv_obj.create({ 'name': reservation.name, diff --git a/golem_resource_account/views/golem_resource_reservation_views.xml b/golem_resource_account/views/golem_resource_reservation_views.xml index 1f4af8a..809edbf 100644 --- a/golem_resource_account/views/golem_resource_reservation_views.xml +++ b/golem_resource_account/views/golem_resource_reservation_views.xml @@ -82,6 +82,25 @@ along with this program. If not, see . --> + + + + + + + + + + + + + + GOLEM Reservation Invoice Wizard Form Editable + golem.reservation.invoice.wizard + +
+ + + +
+
+
+
+
+ + + GOLEM Reservation Invoice Wizard Form + golem.reservation.invoice.wizard + +
+
+
+ + + + +
+