[QUA]Bascic quality enhancements
This commit is contained in:
parent
b745669e40
commit
1957dd8ca2
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user