[WIP] Invoice WorkFlow

This commit is contained in:
Dario Lodeiros
2019-01-18 17:37:43 +01:00
parent c5d3f7facc
commit 9e1bf442b3
6 changed files with 72 additions and 56 deletions

View File

@@ -228,7 +228,6 @@ class HotelFolio(models.Model):
'Prepaid Warning Days',
help='Margin in days to create a notice if a payment \
advance has not been recorded')
rooms_char = fields.Char('Rooms', compute='_computed_rooms_char')
segmentation_ids = fields.Many2many('res.partner.category',
string='Segmentation')
client_order_ref = fields.Char(string='Customer Reference', copy=False)
@@ -253,10 +252,6 @@ class HotelFolio(models.Model):
'amount_total': amount_untaxed + amount_tax,
})
def _computed_rooms_char(self):
for record in self:
record.rooms_char = ', '.join(record.mapped('room_lines.room_id.name'))
@api.depends('amount_total', 'payment_ids', 'return_ids')
@api.multi
def compute_amount(self):

View File

@@ -4,11 +4,21 @@
from odoo import models, fields, api, _
from odoo.addons import decimal_precision as dp
from odoo.exceptions import ValidationError
from datetime import date
class HotelReservationLine(models.Model):
_name = "hotel.reservation.line"
_order = "date"
@api.multi
def name_get(self):
result = []
for res in self:
date = fields.Date.from_string(res.date)
name = u'%s/%s' % (date.day, date.month)
result.append((res.id, name))
return result
reservation_id = fields.Many2one('hotel.reservation', string='Reservation',
ondelete='cascade', required=True,
copy=False)