Fix
This commit is contained in:
parent
7a99631be1
commit
467eff8966
BIN
booking.fodt
BIN
booking.fodt
Binary file not shown.
|
@ -508,11 +508,14 @@ class Booking(Workflow, ModelSQL, ModelView):
|
|||
|
||||
for charge in charges:
|
||||
bk = charge.folio.booking
|
||||
invoice_party_id = charge.invoice_to.id
|
||||
invoice_party_id = fo.booking.party.id
|
||||
if charge.invoice_to:
|
||||
invoice_party_id = charge.invoice_to.id
|
||||
|
||||
unit_price = bk.currency.round(charge.unit_price)
|
||||
if invoice_party_id not in res.keys():
|
||||
res[invoice_party_id] = {
|
||||
'party': charge.invoice_to,
|
||||
'party': invoice_party_id,
|
||||
'currency': bk.currency.id,
|
||||
'payment_term': None,
|
||||
'number': bk.number,
|
||||
|
|
BIN
folio.fodt
BIN
folio.fodt
Binary file not shown.
6
folio.py
6
folio.py
|
@ -222,11 +222,11 @@ class Folio(ModelSQL, ModelView):
|
|||
|
||||
def check_room(self):
|
||||
Housekeeping = Pool().get('hotel.housekeeping')
|
||||
hk, = Housekeeping.search([
|
||||
rooms = Housekeeping.search([
|
||||
('room', '=', self.room.id)
|
||||
])
|
||||
if hk.state != 'clean':
|
||||
raise UserError(gettext('hotel.msg_room_no_clean', s=hk.room.name))
|
||||
if not rooms or rooms[0].state != 'clean':
|
||||
raise UserError(gettext('hotel.msg_room_no_clean', s=self.room.name))
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
|
|
24
service.py
24
service.py
|
@ -238,17 +238,17 @@ class ServiceLine(Workflow, ModelSQL, ModelView):
|
|||
('room', '=', self.room.id),
|
||||
('registration_state', '=', 'check_in'),
|
||||
])
|
||||
# if not folios:
|
||||
# raise UserError(
|
||||
# gettext('hotel.msg_room_not_occupied', s=self.room.name)
|
||||
# )
|
||||
# elif len(folios) > 1:
|
||||
# raise UserError(
|
||||
# gettext('hotel.msg_multiple_rooms_active', s=self.room.name)
|
||||
# )
|
||||
|
||||
if not folios:
|
||||
return
|
||||
raise UserError(
|
||||
gettext('hotel.msg_room_not_occupied', s=self.room.name)
|
||||
)
|
||||
elif len(folios) > 1:
|
||||
raise UserError(
|
||||
gettext('hotel.msg_multiple_rooms_active', s=self.room.name)
|
||||
)
|
||||
|
||||
# if not folios:
|
||||
# return
|
||||
|
||||
folio = folios[0]
|
||||
new_line = {
|
||||
|
@ -257,7 +257,7 @@ class ServiceLine(Workflow, ModelSQL, ModelView):
|
|||
'order': self.order,
|
||||
'description': self.description,
|
||||
'quantity': int(self.quantity),
|
||||
'invoice_to': self.folio.main_guest.id,
|
||||
# 'invoice_to': self.folio.booking.party.id,
|
||||
'unit_price': self.product.template.list_price,
|
||||
'product': self.product.id,
|
||||
'to_invoice': True,
|
||||
|
@ -311,7 +311,7 @@ class CreateDailyServices(Wizard):
|
|||
|
||||
folios = Folio.search([
|
||||
('arrival_date', '<', self.start.date),
|
||||
# ('departure_date', '<', self.start.date),
|
||||
('departure_date', '>=', self.start.date),
|
||||
('registration_state', 'in', ['check_in']),
|
||||
])
|
||||
|
||||
|
|
BIN
statement.fodt
BIN
statement.fodt
Binary file not shown.
Loading…
Reference in New Issue