From 476c1b25b848964fbfe0ce6d9932f538dfe8d2f0 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 26 Mar 2018 11:22:36 +0200 Subject: [PATCH] [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, - })], + })] })