[20.0][ADD] hotel_website: hotel website booking #257
_(ran) = reproduced on a 20.0 database with all eight modules of #250–#257 installed together; (read) = from reading the code, not executed._
No hole found in the booking flow itself: prices, pricelist and partner never come from the client, the cart is re-validated server-side, CSRF tokens are there. What worries me before this is exposed publicly:
1. Anonymous checkout is unthrottled (read): each POST to /rooms/checkout creates a partner and a draft reservation and sends an e-mail to the address typed in. No captcha, no rate limit — a mail relay and a way to flood the front desk. website_cf_turnstile is in 20.0.
2. Reviews publish themselves (is_published defaults to True) and any portal account can post any number, with no stay.
3. Nothing holds a room: a request is a draft with a room type, drafts are ignored by availability and never expire, so several guests can be told "request received" for the last room. Fine as a request form if the page says so; not as a booking engine.
4. Images are inlined as base64 on every /rooms and homepage hit (_hotel_type_images reads image_1024 of every room) — megabytes of uncacheable HTML. /web/image URLs would cache.
5. It restyles every website of the database (title, header brand, footer, homepage; no website_id anywhere) and loads Google Fonts from Google's CDN, which is a GDPR problem for EU sites.
6. Assets: 23 MB, of which 81 of 96 files under static/src/image (9.6 MB, including a 7.5 MB video) are referenced nowhere; no licence or credit is stated for the photos; static/description carries banners for other products. Can the photos' licence be stated, and the unused ones dropped?
7. No i18n/*.pot; room-type pages are excluded from the sitemap.
@Rad0van
Thanks for the thorough review. All seven are addressed in 63626eb:
1. The request form uses the website's captcha (data-captcha + _verify_request_recaptcha_token, so reCAPTCHA or Turnstile, whichever is set up), plus a limit that works without one: 5 requests a day per address, 3 open requests per e-mail.
2. Reviews stay unpublished until the hotel publishes them, and only guests with a confirmed reservation or folio of that room type can review it, once.
3. Kept as a request form: the pages and the acknowledgement now say no room is held until the hotel confirms. Unconfirmed requests are cancelled after a few days (setting, 3 by default) and the guest is told.
4. Photos are /web/image URLs; room types and rooms bookable online allow that through _can_return_content.
5. The hotel layout (homepage, brand, title, copyright) is a per-website setting, on for the first website only. The module no longer loads any font and uses the theme's fonts; Odoo's own theme font settings are left to the website.
6. The unused images and the video are gone (81 files), and so is the app store page with the other products' banners. The module is 5.5 MB now. The photos are credited in readme/CREDITS.md.
7. .pot added, and room type pages are in the sitemap.
vadan-serpentcs
New module: a guest-facing hotel website for the vertical-hotel suite.
Depends on #250 (
vertical_hotel) and #252 (hotel_reservation), including their guest register commits; installed throughtest-requirements.txtuntil they are merged. The "Detect unreleased dependencies" check fails on purpose until then.What it does
/my/reservations; website settings for check-in / check-out timeshotel.room._get_booked_rooms)Tests
Route and booking tests + browser tests (dates widget; full visitor flow with accompanying guests); tested on 20.0 without demo data together with the other hotel modules.