[QUA]Bascic quality enhancements

This commit is contained in:
Fabien BOURGEOIS 2018-03-26 11:01:34 +02:00
parent b745669e40
commit 1957dd8ca2
2 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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,