diff --git a/booking.py b/booking.py index 3aa6875..77dd5b7 100644 --- a/booking.py +++ b/booking.py @@ -778,20 +778,6 @@ class Booking(Workflow, ModelSQL, ModelView): Folio = Pool().get('hotel.folio') Folio.write(list(self.lines), {'registration_state': state}) - def check_rooms(self): - Housekeeping = Pool().get('hotel.housekeeping') - rooms_ids = [] - for folio in self.lines: - if folio.registration_state == 'check_out': - continue - rooms_ids.append(folio.room.id) - housekeepings = Housekeeping.search([ - ('state', '!=', 'clean') - ]) - for hk in housekeepings: - if hk.room.id in rooms_ids: - raise UserError(gettext('hotel.msg_room_no_clean', s=hk.room.name)) - @classmethod def get_context_price(cls, product, party=None, currency=None, _date=None, price_list=None, diff --git a/booking.xml b/booking.xml index 32d82a6..c7022a4 100644 --- a/booking.xml +++ b/booking.xml @@ -189,6 +189,14 @@ this repository contains the full copyright notices and license terms. --> + + + + + + + + diff --git a/folio.py b/folio.py index 3290b73..85d2b9c 100644 --- a/folio.py +++ b/folio.py @@ -214,11 +214,19 @@ class Folio(ModelSQL, ModelView): if rec.room is None: raise UserError(gettext('hotel.msg_missing_select_room')) rec.set_registration_number() - rec.booking.check_rooms() + rec.check_room() rec.add_main_guest() cls.update_room(rec.room, 'dirty') cls.write(records, {'registration_state': 'check_in'}) + def check_room(self): + Housekeeping = Pool().get('hotel.housekeeping') + housekeeping, _ = Housekeeping.search([ + ('room', '=', rec.room.id) + ]) + if housekeeping.state != 'clean': + raise UserError(gettext('hotel.msg_room_no_clean', s=hk.room.name)) + @classmethod @ModelView.button def check_out(cls, records): diff --git a/folio.xml b/folio.xml index 134a7ee..5999a85 100644 --- a/folio.xml +++ b/folio.xml @@ -165,6 +165,38 @@ this repository contains the full copyright notices and license terms. --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Hotel + + Hotel Front-Desk + Hotel Administration @@ -14,6 +17,10 @@ this repository contains the full copyright notices and license terms. --> + + + + @@ -40,8 +47,8 @@ this repository contains the full copyright notices and license terms. --> icons/guests.svg - + diff --git a/housekeeping.xml b/housekeeping.xml index 040918a..37d5535 100644 --- a/housekeeping.xml +++ b/housekeeping.xml @@ -47,6 +47,14 @@ this repository contains the full copyright notices and license terms. --> + + + + + + + + diff --git a/registration_card.fodt b/registration_card.fodt index 9c0143d..4120763 100644 Binary files a/registration_card.fodt and b/registration_card.fodt differ diff --git a/room.xml b/room.xml index e3ab5f0..8560176 100644 --- a/room.xml +++ b/room.xml @@ -123,6 +123,14 @@ this repository contains the full copyright notices and license terms. --> + + + + + + + + diff --git a/service.xml b/service.xml index e74a7a8..80a6ee9 100644 --- a/service.xml +++ b/service.xml @@ -86,6 +86,14 @@ this repository contains the full copyright notices and license terms. --> + + + + + + + +