[IMP] pms: change location of precheckin link

This commit is contained in:
Sara Lago
2021-10-19 16:35:30 +02:00
parent 963cc43bd4
commit bd169cb633
4 changed files with 189 additions and 157 deletions

View File

@@ -626,7 +626,6 @@ class PortalPrecheckin(CustomerPortal):
csrf=False,
)
def portal_precheckin_folio_send_invitation(self, **kw):
print(kw)
if kw.get("folio_id"):
folio = request.env["pms.folio"].browse(int(kw.get("folio_id")))
kw.update({"folio": folio})

View File

@@ -21,57 +21,57 @@
style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"
><tr><td align="center">
<table
border="0"
cellpadding="0"
cellspacing="0"
width="590"
style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;"
>
border="0"
cellpadding="0"
cellspacing="0"
width="590"
style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;"
>
<head>
<link
rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf"
crossorigin="anonymous"
/>
rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf"
crossorigin="anonymous"
/>
</head>
<tbody>
<!-- PROPERTY DESCRIPTION -->
<tr>
<td align="center" style="min-width: 590px;">
<table
width="590"
border="0"
cellpadding="0"
cellspacing="0"
style="min-width: 590px; background-color: white; padding: 0px 0px 0px 0px; border-collapse:separate;"
>
width="590"
border="0"
cellpadding="0"
cellspacing="0"
style="min-width: 590px; background-color: white; padding: 0px 0px 0px 0px; border-collapse:separate;"
>
<tr><td align="right">
<div class="col-sm-4">
% if object.pms_property_id.partner_id.street
<p
>${object.pms_property_id.partner_id.street}</p>
>${object.pms_property_id.partner_id.street}</p>
% endif
% if object.pms_property_id.partner_id.street2
<p
>${object.pms_property_id.partner_id.street2}</p>
>${object.pms_property_id.partner_id.street2}</p>
% endif
<p
>${object.pms_property_id.partner_id.zip}</p>
>${object.pms_property_id.partner_id.zip}</p>
<p
>${object.pms_property_id.partner_id.city}</p>
>${object.pms_property_id.partner_id.city}</p>
<p
>${object.pms_property_id.partner_id.country_id.name}</p>
>${object.pms_property_id.partner_id.country_id.name}</p>
</div>
</td></tr>
<tr><td valign="top" style="font-size: 14px;">
<hr
width="100%"
style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"
/>
width="100%"
style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"
/>
<div>
Hello ${object.partner_id.name or ''},<br
/>
/>
We are happy to confirm your reservation in ${object.pms_property_id.name}
</div>
<div>
@@ -89,76 +89,76 @@
<tr>
<td align="center" style="min-width: 590px;">
<hr
width="100%"
style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"
/>
width="100%"
style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"
/>
<div
align="left"
style="margin: 16px 0px 16px 0px;"
><strong>Reservation Details</strong></div>
align="left"
style="margin: 16px 0px 16px 0px;"
><strong>Reservation Details</strong></div>
<table
width="590"
border="0"
cellpadding="0"
cellspacing="0"
style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;"
>
width="590"
border="0"
cellpadding="0"
cellspacing="0"
style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;"
>
<tr><td valign="top" style="font-size: 14px;">
<table style="width:50%;">
<tr>
<td>
<div
class="far fa-calendar-alt fa-2x"
style="margin: 0px 16px 0px 0px;"
/>
class="far fa-calendar-alt fa-2x"
style="margin: 0px 16px 0px 0px;"
/>
</td>
<td
style="margin: 16px 0px 16px 0px; font-size: 14px;"
>
style="margin: 16px 0px 16px 0px; font-size: 14px;"
>
<div><strong
>From</strong> ${object.checkin} <strong
>At</strong> ${object.arrival_hour}</div>
>From</strong> ${object.checkin} <strong
>At</strong> ${object.arrival_hour}</div>
<div><strong
>To</strong> ${object.checkout} <strong
>At</strong> ${object.departure_hour}</div>
>To</strong> ${object.checkout} <strong
>At</strong> ${object.departure_hour}</div>
<div
style="font-size:12px;color:#9e9e9e"
><i><strong
>TZ</strong> ${object.pms_property_id.tz}</i></div>
style="font-size:12px;color:#9e9e9e"
><i><strong
>TZ</strong> ${object.pms_property_id.tz}</i></div>
</td>
</tr>
<tr>
<td
style="margin: 16px 0px 16px 0px;"
>
style="margin: 16px 0px 16px 0px;"
>
<br />
<div
class="fas fa-bed fa-2x"
style="margin: 0px 16px 0px 0px;"
/>
class="fas fa-bed fa-2x"
style="margin: 0px 16px 0px 0px;"
/>
</td>
<td style="vertical-align:top;">
<br />
<div><strong
>Room: </strong> ${object.room_type_id.name}</div>
>Room: </strong> ${object.room_type_id.name}</div>
</td>
</tr>
<tr>
<td
style="margin: 16px 0px 16px 0px;"
>
style="margin: 16px 0px 16px 0px;"
>
<br />
<div
class="fas fa-coins fa-2x"
style="margin: 0px 16px 0px 0px;"
/>
class="fas fa-coins fa-2x"
style="margin: 0px 16px 0px 0px;"
/>
</td>
<td
style="margin: 16px 0px 16px 0px; font-size: 14px;"
>
style="margin: 16px 0px 16px 0px; font-size: 14px;"
>
<br />
<div><strong
>Price: </strong> ${object.price_room_services_set} ${object.pms_property_id.country_id.currency_id.symbol}</div>
>Price: </strong> ${object.price_room_services_set} ${object.pms_property_id.country_id.currency_id.symbol}</div>
</td>
</tr>
</table>
@@ -168,51 +168,58 @@
<div>
% if object.pms_property_id.mail_information
<hr
width="100%"
style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"
/>
width="100%"
style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"
/>
<div
align="left"
style="margin: 16px 0px 16px 0px;"
><strong
>Additional Information</strong></div>
align="left"
style="margin: 16px 0px 16px 0px;"
><strong
>Additional Information</strong></div>
${object.pms_property_id.mail_information|safe}
% endif
</div>
</td></tr>
<tr>
<td align="center" style="padding: 20px 0 0px 0; ">
<td
align="center"
style="padding: 20px 0 0px 0; "
>
<div>
<hr
width="100%"
style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"
/>
width="100%"
style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"
/>
Do your check-in now and save time.
<br />
Access our<strong
> quick registration system</strong>. In a few steps you will be able to register your data in an agile, simple and secure way,<strong
> avoiding queues at reception</strong>.
> quick registration system</strong>. In a few steps you will be able to register your data in an agile, simple and secure way,<strong
> avoiding queues at reception</strong>.
If you register your data in our system, <strong
> your passage through reception will be much faster</strong>, being able to enjoy the comfort of your room right away.
<table border="0" cellspacing="0" cellpadding="0">
> your passage through reception will be much faster</strong>, being able to enjoy the comfort of your room right away.
<table
border="0"
cellspacing="0"
cellpadding="0"
>
<tr>
<td align="center">
<a
href="/my/folios/${object.folio_id.id}/precheckin?access_token=${object.folio_id.access_token}"
target="_blank"
style="text-decoration: none; color: #FFFFFF; font-size: 2em; padding: 10px 20px 10px 20px;"
>
href="/my/folios/${object.folio_id.id}/precheckin?access_token=${object.folio_id.access_token}"
target="_blank"
style="text-decoration: none; color: #FFFFFF; font-size: 2em; padding: 10px 20px 10px 20px;"
>
<div
style="padding: 0.5em; background-color: #45C2B1; border-color: #45C2B1; border-width: 2px;border-style:solid; border-bottom-style: solid;border-left-style: solid;border-right-style: solid;border-top-style: solid;-webkit-border-radius: 10; -moz-border-radius: 10; border-radius: 10px;font-size: 12px;"
>Check-in
style="padding: 0.5em; background-color: #45C2B1; border-color: #45C2B1; border-width: 2px;border-style:solid; border-bottom-style: solid;border-left-style: solid;border-right-style: solid;border-top-style: solid;-webkit-border-radius: 10; -moz-border-radius: 10; border-radius: 10px;font-size: 12px;"
>Check-in
</div>
<center><img
src="https://www.aldahotels.es/firma/email/llegada/check-in.png"
alt="Hacer check-in"
width="80px"
height="80px"
href="${object.url}"
/></center></a>
src="https://www.aldahotels.es/firma/email/llegada/check-in.png"
alt="Hacer check-in"
width="80px"
height="80px"
href="${object.url}"
/></center></a>
</td>
</tr>
</table>
@@ -221,31 +228,31 @@
</tr>
<tr><td valign="top" style="font-size: 14px;">
<hr
width="100%"
style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"
/>
width="100%"
style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"
/>
<!-- CONTACT -->
<div>
<span
style="font-weight:300;margin:10px 0px"
>Questions about the reservation?</span>
style="font-weight:300;margin:10px 0px"
>Questions about the reservation?</span>
<div>Please contact with us:</div>
<ul>
<li
>${object.pms_property_id.name}</li>
>${object.pms_property_id.name}</li>
% if object.pms_property_id.partner_id.email
<li>Mail: <a
href="mailto:${object.pms_property_id.partner_id.email}"
style="text-decoration:none;color:#875A7B;"
>${object.pms_property_id.partner_id.email}</a></li>
href="mailto:${object.pms_property_id.partner_id.email}"
style="text-decoration:none;color:#875A7B;"
>${object.pms_property_id.partner_id.email}</a></li>
% endif
% if object.pms_property_id.partner_id.phone
<li
>Phone: ${object.pms_property_id.partner_id.phone}</li>
>Phone: ${object.pms_property_id.partner_id.phone}</li>
% endif
% if object.pms_property_id.partner_id.mobile
<li
>Mobile: ${object.pms_property_id.partner_id.mobile}</li>
>Mobile: ${object.pms_property_id.partner_id.mobile}</li>
% endif
</ul>
</div>
@@ -260,12 +267,12 @@
<tr><td align="center" style="min-width: 590px;">
% if object.pms_property_id.privacy_policy
<table
width="590"
border="0"
cellpadding="0"
cellspacing="0"
style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;"
>
width="590"
border="0"
cellpadding="0"
cellspacing="0"
style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;"
>
<tr><td style="font-size: 10px;">
${object.pms_property_id.privacy_policy|safe}
</td></tr>
@@ -275,18 +282,18 @@
<tr><td align="center" style="min-width: 590px;">
% if object.company_id
<table
width="590"
border="0"
cellpadding="0"
cellspacing="0"
style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;"
>
width="590"
border="0"
cellpadding="0"
cellspacing="0"
style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;"
>
<tr><td style="text-align: center; font-size: 10px;">
Sent by <a
target="_blank"
href="${object.company_id.website}"
style="color: #875A7B;"
>${object.company_id.name}</a>
target="_blank"
href="${object.company_id.website}"
style="color: #875A7B;"
>${object.company_id.name}</a>
<br />
</td></tr>
</table>

View File

@@ -63,10 +63,6 @@
>
<t t-esc="folio.name" />
</a>
<a
t-att-href="folio.get_portal_url(suffix='/precheckin')"
t-att-title="Precheckin"
>Precheckin</a>
</td>
<td><span t-field="folio.date_order" /></td>
<td class="text-right"><span
@@ -98,16 +94,16 @@
<ul
class="list-group list-group-flush flex-wrap flex-row flex-lg-column"
>
<li class="list-group-item flex-grow-1">
<li class="list-group-item">
<div class="o_download_pdf btn-toolbar flex-sm-nowrap">
<div class="btn-group flex-grow-1 mr-1 mb-1">
<div class="btn-group mr-1 mb-1">
<a
class="btn btn-secondary btn-block o_download_btn"
t-att-href="folio.get_portal_url(report_type='pdf', download=True)"
title="Download"
><i class="fa fa-download" /> Download</a>
</div>
<div class="btn-group flex-grow-1 mb-1">
<div class="btn-group mb-1">
<a
class="btn btn-secondary btn-block o_print_btn o_portal_invoice_print"
t-att-href="folio.get_portal_url(report_type='pdf')"
@@ -117,6 +113,15 @@
><i class="fa fa-print" /> Print</a>
</div>
</div>
<div>
<a
class="btn btn-secondary btn-block "
t-att-href="folio.get_portal_url(suffix='/precheckin')"
t-att-title="Precheckin"
>
Precheckin
</a>
</div>
</li>
<li

View File

@@ -152,8 +152,8 @@
for="gender"
>Gender</label>
<div class="d-none"><p id="genderId"><t
t-esc="checkin_partner.gender"
/></p></div>
t-esc="checkin_partner.gender"
/></p></div>
<select
class="form-control"
name="gender"
@@ -253,7 +253,10 @@
</t>
</div>
<div class="col-12">
<button type="submit" class="btn btn-primary float-right">
<button
type="submit"
class="btn btn-primary float-right"
>
Confirm
<span class="fa fa-long-arrow-right" />
</button>
@@ -311,8 +314,8 @@
<thead>
<tr class="active">
<th>PreCheckin for <span
t-field="reservation.sudo().room_type_id.name"
/> Room</th>
t-field="reservation.sudo().room_type_id.name"
/> Room</th>
</tr>
</thead>
<tbody>
@@ -633,10 +636,10 @@
for="gender"
>Gender</label>
<div class="d-none"><p
id="genderId"
><t
t-esc="checkin_partner.gender"
/></p></div>
id="genderId"
><t
t-esc="checkin_partner.gender"
/></p></div>
<select
class="form-control"
name="gender"
@@ -802,8 +805,8 @@
<thead>
<tr class="active">
<th>PreCheckin in <span
t-field="folio.pms_property_id.name"
/></th>
t-field="folio.pms_property_id.name"
/></th>
</tr>
</thead>
<tbody>
@@ -878,21 +881,37 @@
t-att-value="id or (checkin_partner.id)"
/>
</div>
<div t-attf-class="form-group col-6">
<a t-att-id="'btn_show_invitation'+str(checkin_partner.id)" class="btn btn-secondary" style="color:#fff;" t-attf-onclick="show_invitation(this)">
<span t-esc="checkin_partner.id" class="d-none"/>
<div t-attf-class="form-group col-6">
<a
t-att-id="'btn_show_invitation'+str(checkin_partner.id)"
class="btn btn-secondary"
style="color:#fff;margin-top:20px;"
t-attf-onclick="show_invitation(this)"
>
<span
t-esc="checkin_partner.id"
class="d-none"
/>
Send Invitation
</a>
<a
t-att-id="'btnResendInvitation' +str(checkin_partner.id)"
onclick="show_invitation(this)"
t-att-class="' btn btn-secondary d-none'"
style="color:#fff;"
style="color:#fff;margin-top:20px;"
>Resend Invitation
<span t-esc="checkin_partner.id" class="d-none"/></a>
<span
t-esc="checkin_partner.id"
class="d-none"
/></a>
</div>
<div class="row col-12 d-none" t-att-id="'invitation_group'+str(checkin_partner.id)">
<div t-attf-class="form-group col-lg-4">
<div
class="row col-12 d-none"
t-att-id="'invitation_group'+str(checkin_partner.id)"
>
<div
t-attf-class="form-group col-4 p-2"
>
<label
id="label_firstname"
class="col-form-label"
@@ -908,7 +927,9 @@
t-att-value="firstname or (checkin_partner.firstname)"
/>
</div>
<div t-attf-class="form-group col-4">
<div
t-attf-class="form-group col-4 p-2"
>
<label
id="label_email"
class="col-form-label"
@@ -925,15 +946,18 @@
/>
</div>
<div
t-attf-class="form-group col-2 m-4 p-3 align-self-center"
t-attf-class="form-group col-4 p-3"
>
<a
id="btnInvitation"
onclick="launchSnackBar(this)"
t-att-class="' btn btn-secondary o_send_invitation_js'"
style="color:#fff;"
>Send Invitation
<span t-esc="checkin_partner.id" class="d-none"/></a>
t-att-class="' btn btn-secondary o_send_invitation_js mt-4 p-2'"
style="color:#fff; height:36px;"
>
Send Invitation<span
t-esc="checkin_partner.id"
class="d-none"
/></a>
</div>
</div>
</div>
@@ -1172,10 +1196,10 @@
for="gender"
>Gender</label>
<div class="d-none"><p
id="genderId"
><t
t-esc="checkin_partner.gender"
/></p></div>
id="genderId"
><t
t-esc="checkin_partner.gender"
/></p></div>
<select
class="form-control"
t-att-name="'gender-'+str(count)"
@@ -1353,7 +1377,6 @@
var checkin_partner_id = element.firstChild.nextSibling.innerText
var divId = "invitation_group" + checkin_partner_id;
var btnId = "btnResendInvitation" + checkin_partner_id;
console.log(btnId)
var div_invitation = document.getElementById(divId);
var btn_show_invitation = document.getElementById(btnId);
console.log(btn_show_invitation)
@@ -1366,11 +1389,9 @@
var divId = "invitation_group" + checkin_partner_id;
var btnId = "btn_show_invitation" + checkin_partner_id;
var btn2 = "btnResendInvitation"+checkin_partner_id;
console.log(btn2)
var div_invitation = document.getElementById(divId);
var btn_show_invitation = document.getElementById(btnId);
var btn_resend = document.getElementById(btn2);
console.log(btn_resend)
div_invitation.classList.remove("d-none");
btn_show_invitation.classList.add("d-none");
btn_resend.classList.add("d-none");