Fix
This commit is contained in:
parent
60341c9228
commit
41f990bc86
4
folio.py
4
folio.py
|
@ -173,8 +173,8 @@ class Folio(ModelSQL, ModelView):
|
|||
return sum(res)
|
||||
|
||||
def get_rec_name(self, name=None):
|
||||
if self.registration_card:
|
||||
name = f'{self.registration_card}:'
|
||||
if self.room:
|
||||
name = f'{self.room.code}:'
|
||||
if self.main_guest:
|
||||
name = name + self.main_guest.name
|
||||
return name
|
||||
|
|
|
@ -27,6 +27,7 @@ class Invoice(metaclass=PoolMeta):
|
|||
for voucher in booking.vouchers:
|
||||
if invoice.party.id == voucher.party.id:
|
||||
vouchers.append(voucher)
|
||||
# FIXME must pass lines of move
|
||||
if vouchers:
|
||||
invoice.create_move_advance(set(vouchers))
|
||||
|
||||
|
|
10
service.py
10
service.py
|
@ -230,9 +230,14 @@ class ServiceLine(Workflow, ModelSQL, ModelView):
|
|||
|
||||
def add_product_to_room(self):
|
||||
FolioCharge = Pool().get('hotel.folio.charge')
|
||||
Folio = Pool().get('hotel.folio')
|
||||
if self.folio_line:
|
||||
return
|
||||
|
||||
folios = Folio.search([
|
||||
('room', '=', self.room.id),
|
||||
('registration_state', '=', 'check_in'),
|
||||
])
|
||||
# if not folios:
|
||||
# raise UserError(
|
||||
# gettext('hotel.msg_room_not_occupied', s=self.room.name)
|
||||
|
@ -242,7 +247,10 @@ class ServiceLine(Workflow, ModelSQL, ModelView):
|
|||
# gettext('hotel.msg_multiple_rooms_active', s=self.room.name)
|
||||
# )
|
||||
|
||||
# folio = folios[0]
|
||||
if not folios:
|
||||
return
|
||||
|
||||
folio = folios[0]
|
||||
new_line = {
|
||||
'folio': self.folio.id,
|
||||
'date_service': self.service.service_date,
|
||||
|
|
Loading…
Reference in New Issue