[IMP] pms: add token in precheckin portal flow

This commit is contained in:
Sara Lago
2023-02-02 16:53:58 +01:00
committed by Darío Lodeiros
parent 3d2cab3d2e
commit eacc0fbed3
3 changed files with 66 additions and 629 deletions

View File

@@ -341,7 +341,7 @@ class PortalPrecheckin(CustomerPortal):
access_token=access_token,
)
except (AccessError, MissingError):
return request.redirect("/my")
return request.render("pms.portal_not_checkin", values)
available_checkins = folio_sudo.checkin_partner_ids.filtered(
lambda c: c.state in ["dummy", "draft"]
)
@@ -352,7 +352,6 @@ class PortalPrecheckin(CustomerPortal):
)
values.update(
{
"no_breadcrumbs": True,
"error": {},
"country_ids": country_ids,
"state_ids": state_ids,
@@ -373,10 +372,17 @@ class PortalPrecheckin(CustomerPortal):
website=True,
csrf=False,
)
def portal_precheckin_folio(self, folio_id, **kw):
folio = request.env["pms.folio"].sudo().browse(folio_id)
values = {}
values.update({"no_breadcrumbs": True, "folio": folio})
def portal_precheckin_folio(self, folio_id, access_token=None, **kw):
values = self._prepare_portal_layout_values()
try:
folio_sudo = self._document_check_access(
"pms.folio",
folio_id,
access_token=access_token,
)
except (AccessError, MissingError):
return request.redirect("/my")
values.update({"no_breadcrumbs": True,"folio": folio_sudo})
return request.render("pms.portal_my_prechekin_folio", values)
@http.route(
@@ -386,12 +392,12 @@ class PortalPrecheckin(CustomerPortal):
website=True,
csrf=False,
)
def portal_precheckin_reservation(self, folio_id, reservation_id, **kw):
def portal_precheckin_reservation(self, folio_id, reservation_id, access_token=None, **kw):
folio = request.env["pms.folio"].sudo().browse(folio_id)
reservation = request.env["pms.reservation"].sudo().browse(reservation_id)
values = {}
values.update({"folio": folio})
values.update({"reservation": reservation})
values.update({"no_breadcrumbs": True,"folio_access_token": access_token, "reservation": reservation})
return request.render("pms.portal_my_prechekin_reservation", values)
@http.route(
@@ -403,29 +409,36 @@ class PortalPrecheckin(CustomerPortal):
website=True,
csrf=False,
)
def portal_precheckin(self, folio_id, reservation_id, checkin_partner_id, **kw):
def portal_precheckin(self, folio_id, reservation_id, checkin_partner_id, access_token=None, **kw):
folio = request.env["pms.folio"].sudo().browse(folio_id)
reservation = request.env["pms.reservation"].sudo().browse(reservation_id)
checkin_partner = (
request.env["pms.checkin.partner"].sudo().browse(checkin_partner_id)
)
try:
checkin_sudo = self._document_check_access(
"pms.checkin.partner",
checkin_partner_id,
access_token=access_token,
)
except (AccessError, MissingError):
return request.render("pms.portal_not_checkin", kw)
values = {}
zip_ids = request.env["res.city.zip"].search([])
country_ids = request.env["res.country"].search([])
state_ids = request.env["res.country.state"].search([])
city_ids = request.env["res.city"].search([])
doc_type_ids = request.env["res.partner.id_category"].sudo().search([])
access_token = checkin_partner.access_token
if not checkin_partner.access_token:
access_token = PortalMixin._portal_ensure_token(checkin_partner)
access_token = checkin_sudo.access_token
if not checkin_sudo.access_token:
access_token = PortalMixin._portal_ensure_token(checkin_sudo)
values.update(
self._precheckin_get_page_view_values(checkin_partner.id, access_token)
self._precheckin_get_page_view_values(checkin_sudo.id, access_token)
)
values.update(
{
"folio_access_token": kw.get("folio_access_token"),
"no_breadcrumbs": True,
"folio": folio,
"reservation": reservation,
"checkin_partner": checkin_partner,
"checkin_partner": checkin_sudo,
"zip_ids": zip_ids,
"country_ids": country_ids,
"state_ids": state_ids,
@@ -433,11 +446,14 @@ class PortalPrecheckin(CustomerPortal):
"doc_type_ids": doc_type_ids,
}
)
if checkin_sudo.state not in ["dummy", "draft"]:
return request.render("pms.portal_not_checkin", values)
return request.render("pms.portal_my_precheckin_detail", values)
@http.route(
[
"/my/precheckin/<int:folio_id>/<int:reservation_id>/checkin/<int:checkin_partner_id>"
"/my/folios/<int:folio_id>/reservations/<int:reservation_id>/checkins/<int:checkin_partner_id>/submit"
],
type="http",
auth="public",
@@ -457,40 +473,22 @@ class PortalPrecheckin(CustomerPortal):
"checkin_partner": checkin_partner,
}
)
# if not kw.get("first") and not kw.get("back") and not error:
# kw.update({"checkin_partner_id": checkin_partner_id})
# if checkin_pos == len(folio_id.checkin_partner_ids):
# values = {
# "folio": folio_id,
# "no_breadcrumbs": True,
# }
# return request.render("pms.portal_my_precheckin_end", values)
# if checkin_pos >= 0:
# available_checkins = folio_id.checkin_partner_ids.filtered(
# lambda c: c.state in ["dummy", "draft"]
# )
# if available_checkins:
# checkin_partner = available_checkins[0]
# else:
# return request.render("pms.portal_not_checkin", values)
folio_access_token = values.get("folio_access_token")
request.env["pms.checkin.partner"]._save_data_from_portal(kw)
folio = request.env["pms.folio"].sudo().browse(folio_id)
reservation = request.env["pms.reservation"].sudo().browse(reservation_id)
values.update(
{
"no_breadcrumbs": True,
"folio": folio,
"reservation": reservation,
}
)
# values.update({"no_breadcrumbs": True})
# if checkin_partner.state not in ["dummy", "draft"]:
# return request.render("pms.portal_not_checkin", values)
return request.render("pms.portal_my_prechekin_reservation", values)
if folio_access_token:
return request.render("pms.portal_my_prechekin_reservation", values)
else:
return request.render("pms.portal_my_precheckin_end", values)
@http.route(
["/my/folios/<int:folio_id>/invitations"],

View File

@@ -575,7 +575,7 @@ class PmsCheckinPartner(models.Model):
def _compute_access_url(self):
super(PmsCheckinPartner, self)._compute_access_url()
for checkin in self:
checkin.access_url = "/my/precheckin/%s/%s/checkin/%s" % (
checkin.access_url = "/my/folios/%s/reservations/%s/checkins/%s" % (
checkin.folio_id.id,
checkin.reservation_id.id,
checkin.id,
@@ -877,6 +877,7 @@ class PmsCheckinPartner(models.Model):
def _save_data_from_portal(self, values):
checkin_partner = values.get("checkin_partner")
values.pop("checkin_partner")
values.pop("folio_access_token")
if values.get("nationality"):
values.update({"nationality_id": int(values.get("nationality_id"))})

View File

@@ -6,7 +6,7 @@
<t t-foreach="folio.reservation_ids" t-as="reservation">
<t t-set="reservation" t-value="reservation" />
<form
t-att-action="'/my/folios/'+str(folio.id)+'/reservations/'+str(reservation.id)+'/checkins'"
t-att-action="folio.get_portal_url(suffix='/reservations/'+str(reservation.id)+'/checkins')"
method="post"
>
<div class="reservation-card">
@@ -70,11 +70,16 @@
<t t-set="checkins_count" t-value="1" />
<t t-foreach="reservation.checkin_partner_ids" t-as="checkin_partner">
<form
t-att-action="'/my/folios/'+str(folio.id)+'/reservations/'+str(reservation.id)+'/checkins/'+str(checkin_partner.id)"
t-att-action="checkin_partner.get_portal_url()"
method="post"
>
<div class="checkin-card">
<input
class="d-none"
id="folio_access_token"
name="folio_access_token"
t-att-value="folio_access_token"
/>
<t t-if="checkin_partner.state not in ['dummy','draft']">
<button disabled="disabled" class="btn-host-complete">
<span style="margin-left: 6px"><t
@@ -143,7 +148,7 @@
<t t-call="portal.portal_layout">
<form
id="checkinForm"
t-att-action="checkin_partner.get_portal_url()"
t-att-action="checkin_partner.get_portal_url(suffix='/submit')"
method="post"
>
<div class="row o_portal_details">
@@ -366,6 +371,12 @@
class="d-none"
id="nationality_id"
name="nationality_id"
/>
<input
class="d-none"
id="folio_access_token"
name="folio_access_token"
t-att-value="folio_access_token"
/>
<div t-attf-class="form-group col-12 col-md-6">
<label
@@ -989,582 +1000,6 @@
}
</script>
</template>
<!-- checkin form-->
<!-- <template id="portal_my_precheckin_detail2" name="My Precheckin">-->
<!-- <t t-call="portal.portal_layout">-->
<!-- <form t-att-action="checkin_partner_id.get_portal_url()" method="post">-->
<!-- <div class="row o_portal_details">-->
<!-- <div id="title" class="form-group col-xl-12">-->
<!-- <center>-->
<!-- <h4 class="font-weight-bold">PreCheckin in <span-->
<!-- t-field="folio.pms_property_id.name"-->
<!-- /></h4>-->
<!-- </center>-->
<!-- </div>-->
<!-- <div class="form-group col-xl-12">-->
<!-- <center>-->
<!-- <h5-->
<!-- class="font-weight-bold mt-2"-->
<!-- t-esc="'Room: '+checkin_partner_id.reservation_id.sudo().room_type_id.name if checkin_partner_id.reservation_id else ''"-->
<!-- />-->
<!-- </center>-->
<!-- <input-->
<!-- type="text"-->
<!-- name="access_token"-->
<!-- id="input_access_token"-->
<!-- class="d-none"-->
<!-- t-att-value="access_token or checkin_partner_id.access_token"-->
<!-- />-->
<!-- <input-->
<!-- type="text"-->
<!-- name="checkin_partner_id"-->
<!-- id="checkin"-->
<!-- class="d-none"-->
<!-- t-att-value="checkin_partner_id.id"-->
<!-- />-->
<!-- <input-->
<!-- type="text"-->
<!-- name="folio_id"-->
<!-- id="folio"-->
<!-- class="d-none"-->
<!-- t-att-value="folio.id"-->
<!-- />-->
<!-- </div>-->
<!-- <t t-if="checkin_pos >= 0">-->
<!-- <div class="form-group col-xl-12">-->
<!-- <center>-->
<!-- <h5 class="font-weight-bold">-->
<!-- Covering <span-->
<!-- t-esc="int(checkin_pos) + 1"-->
<!-- /> partner <br />-->
<!-- <span-->
<!-- t-esc="len(folio.checkin_partner_ids.filtered(lambda c: c.state in ['dummy','draft']))-int(checkin_pos)"-->
<!-- />-->
<!-- partner data to remain to be covered-->
<!-- </h5>-->
<!-- </center>-->
<!-- </div>-->
<!-- </t>-->
<!-- <div class="row justify-content-center">-->
<!-- <div class="col-11 col-md-8 row pt-3">-->
<!-- <div t-attf-class="form-group col-12 col-md-6">-->
<!-- <label class="col-form-label" for="firstname">Name<small-->
<!-- >*</small></label>-->
<!-- <input-->
<!-- type="text"-->
<!-- name="firstname"-->
<!-- t-attf-class="form-control #{error.get('firstname') and 'is-invalid' or ''}"-->
<!-- t-att-value="firstname if error and firstname else ''"-->
<!-- />-->
<!-- <t t-if="error_message">-->
<!-- <span-->
<!-- class="text-danger"-->
<!-- t-esc="error_message.get('firstname')"-->
<!-- />-->
<!-- </t>-->
<!-- </div>-->
<!-- <div t-attf-class="col-12 col-md-6">-->
<!-- <label-->
<!-- class="col-form-label"-->
<!-- for="lastname"-->
<!-- >Lastname</label>-->
<!-- <input-->
<!-- type="text"-->
<!-- name="lastname"-->
<!-- t-attf-class="form-control #{error.get('firstname') and 'is-invalid' or ''}"-->
<!-- t-att-value="lastname if lastname and error else ''"-->
<!-- />-->
<!-- </div>-->
<!-- <div t-attf-class="form-group col-12 col-md-6 pb-md-5">-->
<!-- <label-->
<!-- class="col-form-label"-->
<!-- for="lastname2"-->
<!-- > Second Lastname (Optional)</label>-->
<!-- <input-->
<!-- type="text"-->
<!-- name="lastname2"-->
<!-- t-attf-class="form-control"-->
<!-- t-att-value="lastname2 if error and lastname2 else ''"-->
<!-- />-->
<!-- </div>-->
<!-- <div t-attf-class="col-12 col-md-6 pb-5">-->
<!-- <label-->
<!-- class="col-form-label"-->
<!-- for="gender"-->
<!-- >Gender</label>-->
<!-- <div class="d-none"><p id="genderId"><t-->
<!-- t-esc="gender"-->
<!-- /></p></div>-->
<!-- <select-->
<!-- class="form-control"-->
<!-- name="gender"-->
<!-- t-att-value="gender if gender and error else ''"-->
<!-- t-attf-class="form-control #{error.get('gender') and 'is-invalid' or ''}"-->
<!-- >-->
<!-- <option value="">Select an option</option>-->
<!-- <option-->
<!-- value="female"-->
<!-- t-att-selected="'female' == gender"-->
<!-- >-->
<!-- Female-->
<!-- </option>-->
<!-- <option-->
<!-- value="male"-->
<!-- t-att-selected="'male' == gender"-->
<!-- >-->
<!-- Male-->
<!-- </option>-->
<!-- <option-->
<!-- value="other"-->
<!-- t-att-selected="'other' == gender"-->
<!-- >-->
<!-- Other-->
<!-- </option>-->
<!-- </select>-->
<!-- <t t-if="error_message">-->
<!-- <span-->
<!-- class="text-danger"-->
<!-- t-esc="error_message.get('gender')"-->
<!-- />-->
<!-- </t>-->
<!-- </div>-->
<!-- <div-->
<!-- name="document_type_div"-->
<!-- t-attf-class="col-12 col-md-6"-->
<!-- >-->
<!-- <label-->
<!-- class="col-form-label"-->
<!-- for="document_type"-->
<!-- >Doc. Type</label>-->
<!-- <div class="d-none"><p id="docTypeId"><t-->
<!-- t-esc="document_type"-->
<!-- /></p></div>-->
<!-- <select-->
<!-- class="form-control #{error.get('document_type') and 'is-invalid' or ''}"-->
<!-- name='document_type'-->
<!-- id="doc_type"-->
<!-- >-->
<!-- <option value="">Select an option</option>-->
<!-- <t t-foreach="doc_type_ids" t-as='doc_type'>-->
<!-- <option-->
<!-- t-att-value="doc_type.name"-->
<!-- t-att-selected="doc_type.name == document_type"-->
<!-- >-->
<!-- <t t-esc='doc_type.name' />-->
<!-- </option>-->
<!-- </t>-->
<!-- </select>-->
<!-- <t t-if="error_message">-->
<!-- <span-->
<!-- class="text-danger"-->
<!-- t-esc="error_message.get('document_type')"-->
<!-- />-->
<!-- </t>-->
<!-- </div>-->
<!-- <div-->
<!-- name="document_number_div"-->
<!-- t-attf-class="col-12 col-md-6"-->
<!-- >-->
<!-- <label-->
<!-- class="col-form-label"-->
<!-- for="document_number"-->
<!-- >Doc. Number</label>-->
<!-- <input-->
<!-- type="text"-->
<!-- name="document_number"-->
<!-- t-attf-class="form-control #{error.get('document_number') and 'is-invalid' or ''}"-->
<!-- t-att-value="document_number if document_number and error else ''"-->
<!-- />-->
<!-- <t t-if="error_message">-->
<!-- <span-->
<!-- class="text-danger"-->
<!-- t-esc="error_message.get('document_number')"-->
<!-- />-->
<!-- </t>-->
<!-- </div>-->
<!-- <div t-attf-class="col-12 col-md-6">-->
<!-- <label-->
<!-- class="col-form-label"-->
<!-- for="document_expedition_date"-->
<!-- >Doc. Expedition Date/Doc. Validity Date</label>-->
<!-- <span-->
<!-- class="fa fa-question-circle fa-lg ml-4"-->
<!-- data-toggle="tooltip"-->
<!-- title="If you enter the validity date of the document, the expedition date will be automatically calculated and entered depending on the document type."-->
<!-- />-->
<!-- <input-->
<!-- type="date"-->
<!-- name="document_expedition_date"-->
<!-- t-attf-class="form-control #{error.get('document_expedition_date') and 'is-invalid' or ''}"-->
<!-- t-att-value="document_expedition_date"-->
<!-- />-->
<!-- <t t-if="error_message">-->
<!-- <span-->
<!-- class="text-danger"-->
<!-- t-esc="error_message.get('document_expedition_date')"-->
<!-- />-->
<!-- </t>-->
<!-- </div>-->
<!-- <div t-attf-class="form-group col-12 col-md-6">-->
<!-- <label-->
<!-- class="col-form-label"-->
<!-- for="birthdate_date"-->
<!-- > Birth Date</label>-->
<!-- <input-->
<!-- type="date"-->
<!-- name="birthdate_date"-->
<!-- t-attf-class="form-control #{error.get('birthdate_date') and 'is-invalid' or ''}"-->
<!-- t-att-value="birthdate_date if birthdate_date and error else ''"-->
<!-- />-->
<!-- <t t-if="error_message">-->
<!-- <span-->
<!-- class="text-danger"-->
<!-- t-esc="error_message.get('birthdate_date')"-->
<!-- />-->
<!-- </t>-->
<!-- </div>-->
<!-- <div t-attf-class="col-12 col-md-6">-->
<!-- <label-->
<!-- class="col-form-label"-->
<!-- for="nationality_id"-->
<!-- >Nationality</label>-->
<!-- <select-->
<!-- t-attf-class="form-control #{error.get('nationality_id') and 'is-invalid' or ''}"-->
<!-- id="country"-->
<!-- name='nationality_id'-->
<!-- value="nationality_id if nationality_id and error else ''"-->
<!-- >-->
<!-- <option value="">Select an option</option>-->
<!-- <t t-foreach="country_ids" t-as='country_id'>-->
<!-- <option-->
<!-- t-att-value="country_id.id"-->
<!-- t-att-selected="str(country_id.id) == nationality_id"-->
<!-- >-->
<!-- <t t-esc='country_id.name' />-->
<!-- </option>-->
<!-- </t>-->
<!-- </select>-->
<!-- <t t-if="error_message">-->
<!-- <span-->
<!-- class="text-danger"-->
<!-- t-esc="error_message.get('nationality_id')"-->
<!-- />-->
<!-- </t>-->
<!-- </div>-->
<!-- <div t-attf-class="form-group col-12 col-md-6">-->
<!-- <label-->
<!-- id="label_mobile"-->
<!-- class="col-form-label"-->
<!-- for="mobile"-->
<!-- >Mobile (Optional)</label>-->
<!-- <input-->
<!-- type="phone"-->
<!-- name="mobile"-->
<!-- t-attf-class="form-control #{error.get('mobile') and 'is-invalid' or ''}"-->
<!-- t-att-value="mobile if mobile and error else ''"-->
<!-- />-->
<!-- <t t-if="error_message">-->
<!-- <span-->
<!-- class="text-danger"-->
<!-- t-esc="error_message.get('mobile')"-->
<!-- />-->
<!-- </t>-->
<!-- </div>-->
<!-- <div t-attf-class="form-group col-12 col-md-6">-->
<!-- <label-->
<!-- id="label_phone"-->
<!-- class="col-form-label"-->
<!-- for="phone"-->
<!-- >Phone (Optional)</label>-->
<!-- <input-->
<!-- type="phone"-->
<!-- name="phone"-->
<!-- t-attf-class="form-control #{error.get('phone') and 'is-invalid' or ''}"-->
<!-- t-att-value="phone if phone and error else ''"-->
<!-- />-->
<!-- <t t-if="error_message">-->
<!-- <span-->
<!-- class="text-danger"-->
<!-- t-esc="error_message.get('phone')"-->
<!-- />-->
<!-- </t>-->
<!-- </div>-->
<!-- <div t-attf-class="form-group col-12 col-md-6">-->
<!-- <label-->
<!-- id="label_email"-->
<!-- class="col-form-label"-->
<!-- for="email"-->
<!-- >Email (Optional)</label>-->
<!-- <input-->
<!-- type="email"-->
<!-- name="email"-->
<!-- t-attf-class="form-control #{error.get('email') and 'is-invalid' or ''}"-->
<!-- t-att-value="email if email and error else ''"-->
<!-- />-->
<!-- <t t-if="error_message">-->
<!-- <span-->
<!-- class="text-danger"-->
<!-- t-esc="error_message.get('email')"-->
<!-- />-->
<!-- </t>-->
<!-- </div>-->
<!-- <div t-attf-class="form-group col-md-12 pt-md-5">-->
<!-- <label-->
<!-- class="col-form-label"-->
<!-- for="residence_street"-->
<!-- >Residence Address</label>-->
<!-- <input-->
<!-- type="text"-->
<!-- placeholder="Street"-->
<!-- name="residence_street"-->
<!-- t-attf-class="form-control #{error.get('address') and 'is-invalid' or ''}"-->
<!-- t-att-value="residence_street if residence_street else ''"-->
<!-- />-->
<!-- </div>-->
<!-- <div t-attf-class="form-group col-md-12">-->
<!-- <input-->
<!-- type="text"-->
<!-- placeholder="Second Street (Optional)"-->
<!-- name="residence_street2"-->
<!-- t-attf-class="form-control"-->
<!-- t-att-value="residence_street2 if residence_street2 and error else ''"-->
<!-- />-->
<!-- </div>-->
<!-- <div t-attf-class="form-group col-md-4">-->
<!-- <input-->
<!-- type="text"-->
<!-- placeholder="City"-->
<!-- name="residence_city"-->
<!-- t-attf-class="form-control #{error.get('address') and 'is-invalid' or ''}"-->
<!-- t-att-value="residence_city if residence_city and error else ''"-->
<!-- />-->
<!-- </div>-->
<!-- <div t-attf-class="form-group col-md-4">-->
<!-- <input-->
<!-- type="text"-->
<!-- placeholder="Zip"-->
<!-- name="residence_zip"-->
<!-- t-attf-class="form-control #{error.get('address') and 'is-invalid' or ''}"-->
<!-- t-att-value="residence_zip if residence_zip and error else ''"-->
<!-- />-->
<!-- </div>-->
<!-- <div t-attf-class="form-group col-md-4">-->
<!-- <select-->
<!-- t-attf-class="form-control #{error.get('address') and 'is-invalid' or ''}"-->
<!-- id="residence-country"-->
<!-- name='residence_country_id'-->
<!-- onclick="changeCountryFormClass()"-->
<!-- >-->
<!-- <option-->
<!-- id="country_placeholder"-->
<!-- hidden="1"-->
<!-- value="placeholder"-->
<!-- >Country</option>-->
<!-- <t t-foreach="country_ids" t-as='country_id'>-->
<!-- <option-->
<!-- t-att-value="country_id.id"-->
<!-- t-att-selected="str(country_id.id) == residence_country_id if residence_country_id and error else placeholder"-->
<!-- >-->
<!-- <t t-esc='country_id.name' />-->
<!-- </option>-->
<!-- </t>-->
<!-- </select>-->
<!-- </div>-->
<!-- <div t-attf-class="form-group col-md-12 pb-md-3">-->
<!-- <select-->
<!-- t-attf-class="form-control #{error.get('address') and 'is-invalid' or ''}"-->
<!-- id="residence-state"-->
<!-- name='residence_state_id'-->
<!-- onclick="changeFormClass()"-->
<!-- >-->
<!-- <option-->
<!-- id="placeholder"-->
<!-- hidden="1"-->
<!-- value="placeholder"-->
<!-- >State</option>-->
<!-- <t t-foreach="state_ids" t-as='state'>-->
<!-- <option-->
<!-- t-att-value="state.id"-->
<!-- t-att-country_id="state.country_id.id"-->
<!-- t-att-selected="str(state.id) == residence_state_id if residence_state_id and error else placeholder"-->
<!-- >-->
<!-- <t t-esc="state.name" />-->
<!-- </option>-->
<!-- </t>-->
<!-- </select>-->
<!-- </div>-->
<!-- <t t-if="error_message">-->
<!-- <span-->
<!-- class="text-danger"-->
<!-- t-esc="error_message.get('address')"-->
<!-- />-->
<!-- </t>-->
<!-- <t>-->
<!-- <div id="pager_count" class="col-4 pt-3">-->
<!-- <center>-->
<!-- Page-->
<!-- <span t-esc="int(checkin_pos) + 1" />-->
<!-- of-->
<!-- <span-->
<!-- t-esc="len(folio.checkin_partner_ids.filtered(lambda c: c.state in ['dummy','draft']))"-->
<!-- />-->
<!-- </center>-->
<!-- </div>-->
<!-- <t t-set="checkin_pos" t-value="checkin_pos+1" />-->
<!-- <input-->
<!-- type="number"-->
<!-- name="checkin_pos"-->
<!-- id="input_checkin_pos"-->
<!-- class="d-none"-->
<!-- t-att-value="checkin_pos"-->
<!-- />-->
<!-- <div class="col-6">-->
<!-- <button-->
<!-- type="submit"-->
<!-- class="btn btn-primary float-right"-->
<!-- >-->
<!-- Save and Continue-->
<!-- <span class="fa fa-long-arrow-right" />-->
<!-- </button>-->
<!-- </div>-->
<!-- </t>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </form>-->
<!-- </t>-->
<!-- <style>-->
<!-- #snackbar {-->
<!-- visibility: hidden;-->
<!-- min-width: 250px;-->
<!-- margin-left: -125px;-->
<!-- background-color: #6c757d;-->
<!-- color: #fff;-->
<!-- text-align: center;-->
<!-- border-radius: 2px;-->
<!-- padding: 16px;-->
<!-- position: fixed;-->
<!-- z-index: 1;-->
<!-- left: 50%;-->
<!-- top: 100px;-->
<!-- font-size: 17px;-->
<!-- }-->
<!-- #snackbar.show {-->
<!-- visibility: visible;-->
<!-- -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;-->
<!-- animation: fadein 0.5s, fadeout 0.5s 2.5s;-->
<!-- }-->
<!-- @-webkit-keyframes fadein {-->
<!-- from {top: 0; opacity: 0;}-->
<!-- to {top: 100px; opacity: 1;}-->
<!-- }-->
<!-- @keyframes fadein {-->
<!-- from {top: 0; opacity: 0;}-->
<!-- to {top: 100px; opacity: 1;}-->
<!-- }-->
<!-- @-webkit-keyframes fadeout {-->
<!-- from {top: 100px; opacity: 1;}-->
<!-- to {top: 0; opacity: 0;}-->
<!-- }-->
<!-- @keyframes fadeout {-->
<!-- from {top: 100px; opacity: 1;}-->
<!-- to {top: 0; opacity: 0;}-->
<!-- }-->
<!-- .placeholder-class{-->
<!-- display: block;-->
<!-- width: 100%;-->
<!-- height: calc(1.5em + 0.75rem + 2px);-->
<!-- padding: 0.375rem 0.75rem;-->
<!-- font-size: 0.875rem;-->
<!-- font-weight: 400;-->
<!-- line-height: 1.5;-->
<!-- color: grey;-->
<!-- background-color: #FFFFFF;-->
<!-- background-clip: padding-box;-->
<!-- border: 1px solid #CED4DA;-->
<!-- border-radius: 0.25rem;-->
<!-- transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;-->
<!-- }-->
<!-- </style>-->
<!-- <script>-->
<!-- var placeholder_country = document.getElementById("country_placeholder")-->
<!-- function changeCountryFormClass() {-->
<!-- let select_value = placeholder_country.parentNode.value-->
<!-- if (placeholder_country.parentNode.value == 'placeholder'){-->
<!-- placeholder_country.parentNode.classList.add('placeholder-class')-->
<!-- }else{-->
<!-- placeholder_country.parentNode.classList.remove('placeholder-class')-->
<!-- }-->
<!-- };-->
<!-- this.changeCountryFormClass()-->
<!-- var placeholder = document.getElementById("placeholder")-->
<!-- function changeFormClass() {-->
<!-- let select_value = placeholder.parentNode.value-->
<!-- if (placeholder.parentNode.value == 'placeholder'){-->
<!-- placeholder.parentNode.classList.remove('form-control')-->
<!-- placeholder.parentNode.classList.add('placeholder-class')-->
<!-- }else{-->
<!-- placeholder.parentNode.classList.remove('placeholder-class')-->
<!-- placeholder.parentNode.classList.add('form-control')-->
<!-- }-->
<!-- };-->
<!-- this.changeFormClass()-->
<!-- let select_residence_country = document.getElementById('residence-country')-->
<!-- select_residence_country.addEventListener("change", () => {-->
<!-- let country_value = select_residence_country.value-->
<!-- Array.from(document.getElementById('residence-state').options).forEach(element => {-->
<!-- if (element.getAttribute('country_id') == country_value) {-->
<!-- element.style="";-->
<!-- } else {-->
<!-- element.style="display:none";-->
<!-- }-->
<!-- });-->
<!-- });-->
<!-- var select_doc_type = document.getElementById("doc_type")-->
<!-- var document_type_value = document.getElementById("docTypeId").textContent-->
<!-- for (let i=0;i&lt;select_doc_type.length;i++){-->
<!-- if (select_doc_type[i].value == document_type_value){-->
<!-- select_doc_type[i].setAttribute("selected","True")-->
<!-- }-->
<!-- }-->
<!-- var folio_id = document.getElementById("folio").value-->
<!-- var checkin_partner_id = document.getElementById("checkin").value-->
<!-- var access_token = document.getElementById("input_access_token").value-->
<!-- var checkin_pos = document.getElementById("input_checkin_pos").value;-->
<!-- window.history.pushState(null, '', '/my/precheckin/'+folio_id+'/checkin/'+checkin_partner_id +'?access_token='+ access_token);-->
<!-- function launchSnackBar(element) {-->
<!-- var x = document.getElementById("snackbar");-->
<!-- if (checkin_pos == -1){-->
<!-- x.className = "show";-->
<!-- setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);-->
<!-- }-->
<!-- }-->
<!-- var select_doc_type = document.getElementById("doc_type")-->
<!-- var document_type_value = document.getElementById("docTypeId").textContent-->
<!-- for (let i=0;i&lt;select_doc_type.length;i++){-->
<!-- if (select_doc_type[i].value == document_type_value){-->
<!-- select_doc_type[i].setAttribute("selected","True")-->
<!-- }-->
<!-- }-->
<!-- </script>-->
<!-- </template>-->
<!-- precheckin buttons and send invitations -->
<template id="portal_my_reservation_precheckin" name="Precheckin Reservation">
<t t-call="portal.portal_layout">
@@ -1626,9 +1061,9 @@
<form
class="col-6"
style="margin-bottom:50px"
t-att-action="'/my/folios/'+str(folio.id)+'/reservations'"
t-att-action="folio.get_portal_url(suffix='/reservations')"
method="post"
> <!--t-att-action="'/my/precheckin/'+str(folio.id)+'/checkin/'+str(checkin_partner_id.id)"-->
>
<input
type="text"
name="access_token"
@@ -1663,7 +1098,7 @@
</form>
</div>
<center>
<t t-if="len(folio.checkin_partner_ids) &gt; 1">
<t t-if="len(folio.checkin_partner_ids.filtered(lambda c: c.state in ['dummy','draft'])) &gt;= 1">
<div>
If you wish, you can share with the rest of the guests the access to their check-in so that they can fill it out.<br
/>
@@ -1726,12 +1161,12 @@
</tr>
<t
t-foreach="reservation.checkin_partner_ids"
t-foreach="reservation.checkin_partner_ids.filtered(lambda c: c.state in ['dummy','draft'])"
t-as="checkin_partner"
>
<t
t-set="url"
t-value="'/my/precheckin/'+str(folio.id)+'/checkin/'+str(checkin_partner.id)"
t-value="'/my/folios/'+str(folio.id)+'/reservations/'+str(reservation.id)+'/checkin/'+str(checkin_partner.id)"
/>
<t
t-set="count_reservation"
@@ -1954,6 +1389,9 @@
}
}
var checkin_partner_id = element.firstChild.nextSibling.innerText
var divId = "invitation_group" + checkin_partner_id;
document.getElementById(divId).classList.add("d-none");
}
function show_invitation(element) {