[IMP]pms: added template for checkin done

This commit is contained in:
braisab
2022-02-03 21:17:13 +01:00
parent 1d21c36af1
commit 8c7f2d3d58
2 changed files with 57 additions and 10 deletions

View File

@@ -334,9 +334,13 @@ class PortalPrecheckin(CustomerPortal):
"doc_type_ids": doc_type_ids,
"folio": folio_sudo,
"checkin_partner_id": checkin_partner,
"checkin_pos": 0,
}
)
return request.render("pms.portal_my_reservation_precheckin", values)
if checkin_partner.state == "draft" or checkin_partner.state == "confirm":
return request.render("pms.portal_my_reservation_precheckin", values)
else:
return request.render("pms.portal_not_checkin", values)
@http.route(
["/my/precheckin/<int:folio_id>/checkin/<int:checkin_partner_id>"],
@@ -351,7 +355,7 @@ class PortalPrecheckin(CustomerPortal):
checkin_pos = int(kw.get("checkin_pos"))
else:
checkin_pos = -2
folio_id = request.env["pms.folio"].browse(folio_id)
folio_id = request.env["pms.folio"].sudo().browse(folio_id)
country_ids = request.env["res.country"].search([])
state_ids = request.env["res.country.state"].search([])
doc_type_ids = request.env["res.partner.id_category"].sudo().search([])
@@ -415,8 +419,11 @@ class PortalPrecheckin(CustomerPortal):
)
except (AccessError, MissingError):
return request.redirect("/my")
web_url = request.env["ir.config_parameter"].search(
[("key", "=", "web.base.url")]
)
values = self._folio_get_page_view_values(folio_sudo, access_token, **kw)
values.update({"no_breadcrumbs": True, "error": {}})
values.update({"no_breadcrumbs": True, "error": {}, "web_url": web_url.value})
return request.render("pms.portal_my_folio_invitations", values)
def form_validate(self, data, counter):

View File

@@ -2,10 +2,16 @@
<odoo>
<template id="portal_my_precheckin_detail" name="My Precheckin">
<t t-call="portal.portal_layout">
<t t-set="additional_title">Contact Details</t>
<form t-att-action="checkin_partner_id.get_portal_url()" method="post">
<div class="row o_portal_details">
<div t-attf-class="form-group col-xl-6">
<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-6">
<center>
<h5
class="font-weight-bold mr-5 mt-2"
@@ -34,8 +40,16 @@
t-att-value="folio.id"
/>
</div>
<t t-if="checkin_pos >= 0">
<div class="col-4 mt-2">
<h5 class="float-right font-weight-bold">
Check-in
<span t-esc="int(checkin_pos) + 1" />
</h5>
</div>
</t>
<div class="row justify-content-center">
<div class="col-11 col-md-8 row pt-5">
<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"
@@ -62,7 +76,7 @@
<input
type="text"
name="lastname"
t-attf-class="form-control "
t-attf-class="form-control"
t-att-value="checkin_partner_id.lastname"
/>
</div>
@@ -242,6 +256,7 @@
</div>
<div t-attf-class="form-group col-12 col-md-6 pt-5">
<label
id="label_mobile"
class="col-form-label"
for="mobile"
>Mobile</label>
@@ -259,7 +274,11 @@
</t>
</div>
<div t-attf-class="form-group col-12 col-md-6 pt-md-5">
<label class="col-form-label" for="email">Email</label>
<label
id="label_email"
class="col-form-label"
for="email"
>Email</label>
<input
type="email"
name="email"
@@ -443,7 +462,11 @@
<t t-call="portal.portal_layout">
<thead style="background-color: white;">
<tr class="active">
<th>PreCheckin in <span t-field="folio.pms_property_id.name" /></th>
<center>
<h4>PreCheckin in <span
t-field="folio.pms_property_id.name"
/></h4>
</center>
</tr>
</thead>
<center>
@@ -530,6 +553,9 @@
</center>
</t>
<style>
</style>
</template>
<template id="portal_my_folio_invitations" name="Precheckin Folio">
<t t-call="portal.portal_layout">
@@ -635,7 +661,7 @@
<a
t-att-id="'btn_show_invitation_whatsapp'+str(checkin_partner.id)"
class="' btn btn-secondary"
t-att-href="'whatsapp://send?text='+checkin_partner.get_portal_url()"
t-att-href="'whatsapp://send?text='+web_url+checkin_partner.get_portal_url()"
style="color:#fff;margin-top:20px;"
t-attf-onclick="show_invitation(this)"
>
@@ -1048,5 +1074,19 @@
</table>
</table>
</t>
<style />
</template>
<template id="portal_not_checkin" name="Not Checkin">
<t t-call="portal.portal_layout">
<center>
The quick registration system is not available because the date of your reservation has already passed.<br
/>
If you have any questions, you can contact us by phone: <span><t
t-esc="folio.pms_property_id.phone"
/></span> or by email: <span><t
t-esc="folio.pms_property_id.email"
/></span>
</center>
</t>
</template>
</odoo>