[IMP]pms: Improvements in precheckin portal

This commit is contained in:
braisab
2021-10-19 12:59:41 +02:00
parent 75bd20882f
commit 963cc43bd4
4 changed files with 306 additions and 231 deletions

View File

@@ -626,6 +626,7 @@ class PortalPrecheckin(CustomerPortal):
csrf=False, csrf=False,
) )
def portal_precheckin_folio_send_invitation(self, **kw): def portal_precheckin_folio_send_invitation(self, **kw):
print(kw)
if kw.get("folio_id"): if kw.get("folio_id"):
folio = request.env["pms.folio"].browse(int(kw.get("folio_id"))) folio = request.env["pms.folio"].browse(int(kw.get("folio_id")))
kw.update({"folio": folio}) 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;" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"
><tr><td align="center"> ><tr><td align="center">
<table <table
border="0" border="0"
cellpadding="0" cellpadding="0"
cellspacing="0" cellspacing="0"
width="590" width="590"
style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;"
> >
<head> <head>
<link <link
rel="stylesheet" rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf"
crossorigin="anonymous" crossorigin="anonymous"
/> />
</head> </head>
<tbody> <tbody>
<!-- PROPERTY DESCRIPTION --> <!-- PROPERTY DESCRIPTION -->
<tr> <tr>
<td align="center" style="min-width: 590px;"> <td align="center" style="min-width: 590px;">
<table <table
width="590" width="590"
border="0" border="0"
cellpadding="0" cellpadding="0"
cellspacing="0" cellspacing="0"
style="min-width: 590px; background-color: white; padding: 0px 0px 0px 0px; border-collapse:separate;" style="min-width: 590px; background-color: white; padding: 0px 0px 0px 0px; border-collapse:separate;"
> >
<tr><td align="right"> <tr><td align="right">
<div class="col-sm-4"> <div class="col-sm-4">
% if object.pms_property_id.partner_id.street % if object.pms_property_id.partner_id.street
<p <p
>${object.pms_property_id.partner_id.street}</p> >${object.pms_property_id.partner_id.street}</p>
% endif % endif
% if object.pms_property_id.partner_id.street2 % if object.pms_property_id.partner_id.street2
<p <p
>${object.pms_property_id.partner_id.street2}</p> >${object.pms_property_id.partner_id.street2}</p>
% endif % endif
<p <p
>${object.pms_property_id.partner_id.zip}</p> >${object.pms_property_id.partner_id.zip}</p>
<p <p
>${object.pms_property_id.partner_id.city}</p> >${object.pms_property_id.partner_id.city}</p>
<p <p
>${object.pms_property_id.partner_id.country_id.name}</p> >${object.pms_property_id.partner_id.country_id.name}</p>
</div> </div>
</td></tr> </td></tr>
<tr><td valign="top" style="font-size: 14px;"> <tr><td valign="top" style="font-size: 14px;">
<hr <hr
width="100%" 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;" 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> <div>
Hello ${object.partner_id.name or ''},<br Hello ${object.partner_id.name or ''},<br
/> />
We are happy to confirm your reservation in ${object.pms_property_id.name} We are happy to confirm your reservation in ${object.pms_property_id.name}
</div> </div>
<div> <div>
@@ -89,123 +89,163 @@
<tr> <tr>
<td align="center" style="min-width: 590px;"> <td align="center" style="min-width: 590px;">
<hr <hr
width="100%" 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;" 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 <div
align="left" align="left"
style="margin: 16px 0px 16px 0px;" style="margin: 16px 0px 16px 0px;"
><strong>Reservation Details</strong></div> ><strong>Reservation Details</strong></div>
<table <table
width="590" width="590"
border="0" border="0"
cellpadding="0" cellpadding="0"
cellspacing="0" cellspacing="0"
style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;"
> >
<tr><td valign="top" style="font-size: 14px;"> <tr><td valign="top" style="font-size: 14px;">
<table style="width:50%;"> <table style="width:50%;">
<tr> <tr>
<td> <td>
<div <div
class="far fa-calendar-alt fa-2x" class="far fa-calendar-alt fa-2x"
style="margin: 0px 16px 0px 0px;" style="margin: 0px 16px 0px 0px;"
/> />
</td> </td>
<td <td
style="margin: 16px 0px 16px 0px; font-size: 14px;" style="margin: 16px 0px 16px 0px; font-size: 14px;"
> >
<div><strong <div><strong
>From</strong> ${object.checkin} <strong >From</strong> ${object.checkin} <strong
>At</strong> ${object.arrival_hour}</div> >At</strong> ${object.arrival_hour}</div>
<div><strong <div><strong
>To</strong> ${object.checkout} <strong >To</strong> ${object.checkout} <strong
>At</strong> ${object.departure_hour}</div> >At</strong> ${object.departure_hour}</div>
<div <div
style="font-size:12px;color:#9e9e9e" style="font-size:12px;color:#9e9e9e"
><i><strong ><i><strong
>TZ</strong> ${object.pms_property_id.tz}</i></div> >TZ</strong> ${object.pms_property_id.tz}</i></div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td <td
style="margin: 16px 0px 16px 0px;" style="margin: 16px 0px 16px 0px;"
> >
<br /> <br />
<div <div
class="fas fa-bed fa-2x" class="fas fa-bed fa-2x"
style="margin: 0px 16px 0px 0px;" style="margin: 0px 16px 0px 0px;"
/> />
</td> </td>
<td style="vertical-align:top;"> <td style="vertical-align:top;">
<br /> <br />
<div><strong <div><strong
>Room: </strong> ${object.room_type_id.name}</div> >Room: </strong> ${object.room_type_id.name}</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td <td
style="margin: 16px 0px 16px 0px;" style="margin: 16px 0px 16px 0px;"
> >
<br /> <br />
<div <div
class="fas fa-coins fa-2x" class="fas fa-coins fa-2x"
style="margin: 0px 16px 0px 0px;" style="margin: 0px 16px 0px 0px;"
/> />
</td> </td>
<td <td
style="margin: 16px 0px 16px 0px; font-size: 14px;" style="margin: 16px 0px 16px 0px; font-size: 14px;"
> >
<br /> <br />
<div><strong <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> </td>
</tr> </tr>
</table> </table>
</td></tr> </td></tr>
<tr><td valign="top" style="font-size: 14px;"> <tr><td valign="top" style="font-size: 14px;">
<div> <div>
% if object.pms_property_id.mail_information % if object.pms_property_id.mail_information
<hr <hr
width="100%" 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;" 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 <div
align="left" align="left"
style="margin: 16px 0px 16px 0px;" style="margin: 16px 0px 16px 0px;"
><strong ><strong
>Additional Information</strong></div> >Additional Information</strong></div>
${object.pms_property_id.mail_information|safe} ${object.pms_property_id.mail_information|safe}
% endif % endif
</div> </div>
</td></tr> </td></tr>
<tr>
<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;"
/>
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>.
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">
<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;"
>
<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
</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>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr><td valign="top" style="font-size: 14px;"> <tr><td valign="top" style="font-size: 14px;">
<hr <hr
width="100%" 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;" 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 --> <!-- CONTACT -->
<div> <div>
<span <span
style="font-weight:300;margin:10px 0px" style="font-weight:300;margin:10px 0px"
>Questions about the reservation?</span> >Questions about the reservation?</span>
<div>Please contact with us:</div> <div>Please contact with us:</div>
<ul> <ul>
<li <li
>${object.pms_property_id.name}</li> >${object.pms_property_id.name}</li>
% if object.pms_property_id.partner_id.email % if object.pms_property_id.partner_id.email
<li>Mail: <a <li>Mail: <a
href="mailto:${object.pms_property_id.partner_id.email}" href="mailto:${object.pms_property_id.partner_id.email}"
style="text-decoration:none;color:#875A7B;" style="text-decoration:none;color:#875A7B;"
>${object.pms_property_id.partner_id.email}</a></li> >${object.pms_property_id.partner_id.email}</a></li>
% endif % endif
% if object.pms_property_id.partner_id.phone % if object.pms_property_id.partner_id.phone
<li <li
>Phone: ${object.pms_property_id.partner_id.phone}</li> >Phone: ${object.pms_property_id.partner_id.phone}</li>
% endif % endif
% if object.pms_property_id.partner_id.mobile % if object.pms_property_id.partner_id.mobile
<li <li
>Mobile: ${object.pms_property_id.partner_id.mobile}</li> >Mobile: ${object.pms_property_id.partner_id.mobile}</li>
% endif % endif
</ul> </ul>
</div> </div>
@@ -220,12 +260,12 @@
<tr><td align="center" style="min-width: 590px;"> <tr><td align="center" style="min-width: 590px;">
% if object.pms_property_id.privacy_policy % if object.pms_property_id.privacy_policy
<table <table
width="590" width="590"
border="0" border="0"
cellpadding="0" cellpadding="0"
cellspacing="0" cellspacing="0"
style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;" style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;"
> >
<tr><td style="font-size: 10px;"> <tr><td style="font-size: 10px;">
${object.pms_property_id.privacy_policy|safe} ${object.pms_property_id.privacy_policy|safe}
</td></tr> </td></tr>
@@ -235,18 +275,18 @@
<tr><td align="center" style="min-width: 590px;"> <tr><td align="center" style="min-width: 590px;">
% if object.company_id % if object.company_id
<table <table
width="590" width="590"
border="0" border="0"
cellpadding="0" cellpadding="0"
cellspacing="0" cellspacing="0"
style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;" style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;"
> >
<tr><td style="text-align: center; font-size: 10px;"> <tr><td style="text-align: center; font-size: 10px;">
Sent by <a Sent by <a
target="_blank" target="_blank"
href="${object.company_id.website}" href="${object.company_id.website}"
style="color: #875A7B;" style="color: #875A7B;"
>${object.company_id.name}</a> >${object.company_id.name}</a>
<br /> <br />
</td></tr> </td></tr>
</table> </table>

View File

@@ -13,6 +13,7 @@ odoo.define("pms.SendInvitationData", function (require) {
_onReminderToggleClick: function (ev) { _onReminderToggleClick: function (ev) {
ev.preventDefault(); ev.preventDefault();
var checkinPartnerId = $(ev.currentTarget) var checkinPartnerId = $(ev.currentTarget)
.parent()
.parent() .parent()
.parent() .parent()
.find("input[name=checkin_partner_id]") .find("input[name=checkin_partner_id]")

View File

@@ -17,9 +17,9 @@
/> />
</div> </div>
<div class="col-lg-12"> <div class="row justify-content-center">
<div class="row"> <div class="col-7 col-md-10 row">
<div t-attf-class="form-group col-xl-4 pb-xl-5 pt-xl-5"> <div t-attf-class="form-group col-12 pt-5">
<label <label
class="col-form-label" class="col-form-label"
for="firstname" for="firstname"
@@ -37,7 +37,7 @@
/> />
</t> </t>
</div> </div>
<div t-attf-class="form-group col-xl-4 pt-xl-5"> <div t-attf-class="form-group col-6 pb-5">
<label <label
class="col-form-label" class="col-form-label"
for="lastname" for="lastname"
@@ -49,7 +49,7 @@
t-att-value="lastname or checkin_partner.lastname" t-att-value="lastname or checkin_partner.lastname"
/> />
</div> </div>
<div t-attf-class="form-group col-xl-4 pt-xl-5"> <div t-attf-class="form-group col-6 pb-5">
<label <label
class="col-form-label" class="col-form-label"
for="lastname2" for="lastname2"
@@ -61,7 +61,7 @@
t-att-value="lastname2 or checkin_partner.lastname2" t-att-value="lastname2 or checkin_partner.lastname2"
/> />
</div> </div>
<div t-attf-class="form-group col-xl-4 pb-xl-5"> <div t-attf-class="form-group col-5">
<label <label
class="col-form-label" class="col-form-label"
for="document_type" for="document_type"
@@ -87,7 +87,7 @@
/> />
</t> </t>
</div> </div>
<div t-attf-class="form-group col-xl-4"> <div t-attf-class="col-7">
<label <label
class="col-form-label" class="col-form-label"
for="document_number" for="document_number"
@@ -105,16 +105,15 @@
/> />
</t> </t>
</div> </div>
<div t-attf-class="form-group col-xl-4"> <div t-attf-class="col-6">
<label <label
class="col-form-label" class="col-form-label"
for="document_expedition_date" for="document_expedition_date"
>Doc. Expedition Date/Doc. Validity Date</label> >Doc. Expedition Date/Doc. Validity Date</label>
<span <span
class="fa fa-question-circle fa-lg" class="fa fa-question-circle fa-lg ml-4"
data-toggle="tooltip" 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." title="If you enter the validity date of the document, the expedition date will be automatically calculated and entered depending on the document type."
style="margin-left: 70px;"
/> />
<input <input
type="date" type="date"
@@ -129,7 +128,7 @@
/> />
</t> </t>
</div> </div>
<div t-attf-class="form-group col-xl-4 pb-xl-5"> <div t-attf-class="form-group col-6">
<label <label
class="col-form-label" class="col-form-label"
for="birthdate_date" for="birthdate_date"
@@ -147,47 +146,14 @@
/> />
</t> </t>
</div> </div>
<div t-attf-class="form-group col-xl-4"> <div t-attf-class="col-4">
<label
class="col-form-label"
for="mobile"
>Mobile</label>
<input
type="phone"
name="mobile"
t-attf-class="form-control #{error.get('mobile') and 'is-invalid' or ''}"
t-att-value="mobile or checkin_partner.mobile"
/>
<t t-if="error_message">
<span
class="text-danger"
t-esc="error_message.get('mobile')"
/>
</t>
</div>
<div t-attf-class="form-group col-xl-4">
<label class="col-form-label" for="email">Email</label>
<input
type="email"
name="email"
t-attf-class="form-control #{error.get('email') and 'is-invalid' or ''}"
t-att-value="email or checkin_partner.email"
/>
<t t-if="error_message">
<span
class="text-danger"
t-esc="error_message.get('email')"
/>
</t>
</div>
<div t-attf-class="form-group col-xl-4 pb-xl-5">
<label <label
class="col-form-label" class="col-form-label"
for="gender" for="gender"
>Gender</label> >Gender</label>
<div class="d-none"><p id="genderId"><t <div class="d-none"><p id="genderId"><t
t-esc="checkin_partner.gender" t-esc="checkin_partner.gender"
/></p></div> /></p></div>
<select <select
class="form-control" class="form-control"
name="gender" name="gender"
@@ -214,7 +180,7 @@
</option> </option>
</select> </select>
</div> </div>
<div t-attf-class="form-group col-xl-4"> <div t-attf-class="col-4">
<label <label
class="col-form-label" class="col-form-label"
for="nationality_id" for="nationality_id"
@@ -235,7 +201,7 @@
</t> </t>
</select> </select>
</div> </div>
<div class="form-group col-xl-4"> <div class="form-group col-4">
<label <label
class="col-form-label" class="col-form-label"
for="state" for="state"
@@ -253,15 +219,48 @@
</t> </t>
</select> </select>
</div> </div>
<div t-attf-class="form-group col-6 pt-5">
<label
class="col-form-label"
for="mobile"
>Mobile</label>
<input
type="phone"
name="mobile"
t-attf-class="form-control #{error.get('mobile') and 'is-invalid' or ''}"
t-att-value="mobile or checkin_partner.mobile"
/>
<t t-if="error_message">
<span
class="text-danger"
t-esc="error_message.get('mobile')"
/>
</t>
</div>
<div t-attf-class="form-group col-6 pt-5">
<label class="col-form-label" for="email">Email</label>
<input
type="email"
name="email"
t-attf-class="form-control #{error.get('email') and 'is-invalid' or ''}"
t-att-value="email or checkin_partner.email"
/>
<t t-if="error_message">
<span
class="text-danger"
t-esc="error_message.get('email')"
/>
</t>
</div>
<div class="col-12">
<button type="submit" class="btn btn-primary float-right">
Confirm
<span class="fa fa-long-arrow-right" />
</button>
</div>
</div> </div>
</div> </div>
</div> </div>
<div>
<button type="submit" class="btn btn-primary float-right mb32 ">
Confirm
<span class="fa fa-long-arrow-right" />
</button>
</div>
</form> </form>
</t> </t>
<script> <script>
@@ -312,8 +311,8 @@
<thead> <thead>
<tr class="active"> <tr class="active">
<th>PreCheckin for <span <th>PreCheckin for <span
t-field="reservation.sudo().room_type_id.name" t-field="reservation.sudo().room_type_id.name"
/> Room</th> /> Room</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -327,38 +326,38 @@
t-as="checkin_partner" t-as="checkin_partner"
> >
<t t-set="id1" t-value="'counter'+ str(count)" /> <t t-set="id1" t-value="'counter'+ str(count)" />
<t t-set="id2" t-value="'#'" /> <t t-set="id2" t-value="'#'" />
<t t-set="id3" t-value="id2+id1" /> <t t-set="id3" t-value="id2+id1" />
<t t-set="idcheckin" t-value="'checkin' + str(count)" /> <t t-set="idcheckin" t-value="'checkin' + str(count)" />
<t t-set="count" t-value="count+1" /> <t t-set="count" t-value="count+1" />
<tr> <tr>
<td colspan="4"> <td colspan="4">
<t t-if="not checkin_partner.firstname"> <t t-if="not checkin_partner.firstname">
<a <a
name="url_acess_token" name="url_acess_token"
t-att-href="checkin_partner.get_portal_url()" t-att-href="checkin_partner.get_portal_url()"
> >
Host <t t-esc="count" /> Host <t t-esc="count" />
</a> </a>
<a <a
data-toggle="collapse" data-toggle="collapse"
t-att-data-target="id3" t-att-data-target="id3"
class="text-primary" class="text-primary"
> >
<span <span
t-att-id="count" t-att-id="count"
class="fa fa-chevron-down fa-sm" class="fa fa-chevron-down fa-sm"
/> />
</a> </a>
<div class="row col-12"> <div class="row col-12">
<div t-attf-class="d-none"> <div t-attf-class="d-none">
<label <label
class="col-form-label" class="col-form-label"
for="checkin_partner_id" for="checkin_partner_id"
> >
Name Name
</label> </label>
<input <input
type="text" type="text"
t-att-name="'checkin_partner_id'" t-att-name="'checkin_partner_id'"
t-attf-class="form-control" t-attf-class="form-control"
@@ -634,10 +633,10 @@
for="gender" for="gender"
>Gender</label> >Gender</label>
<div class="d-none"><p <div class="d-none"><p
id="genderId" id="genderId"
><t ><t
t-esc="checkin_partner.gender" t-esc="checkin_partner.gender"
/></p></div> /></p></div>
<select <select
class="form-control" class="form-control"
name="gender" name="gender"
@@ -803,8 +802,8 @@
<thead> <thead>
<tr class="active"> <tr class="active">
<th>PreCheckin in <span <th>PreCheckin in <span
t-field="folio.pms_property_id.name" t-field="folio.pms_property_id.name"
/></th> /></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -866,17 +865,12 @@
> >
<span <span
t-att-id="count" t-att-id="count"
t-name="span_count"
class="fa fa-chevron-down fa-sm" class="fa fa-chevron-down fa-sm"
/> />
</a> </a>
<div class="row col-12"> <div class="row col-12">
<div t-attf-class="d-none"> <div t-attf-class="d-none">
<label
class="col-form-label"
for="checkin_partner_id"
>
Name
</label>
<input <input
type="text" type="text"
t-att-name="'checkin_partner_id'" t-att-name="'checkin_partner_id'"
@@ -884,47 +878,63 @@
t-att-value="id or (checkin_partner.id)" t-att-value="id or (checkin_partner.id)"
/> />
</div> </div>
<div t-attf-class="form-group col-lg-4"> <div t-attf-class="form-group col-6">
<label <a t-att-id="'btn_show_invitation'+str(checkin_partner.id)" class="btn btn-secondary" style="color:#fff;" t-attf-onclick="show_invitation(this)">
id="label_firstname" <span t-esc="checkin_partner.id" class="d-none"/>
class="col-form-label" Send Invitation
for="invitation_firstname" </a>
>
Name
</label>
<input
id="invitation_firstname"
type="text"
t-att-name="'invitation_firstname'"
t-attf-class="form-control"
t-att-value="firstname or (checkin_partner.firstname)"
/>
</div>
<div t-attf-class="form-group col-4">
<label
id="label_email"
class="col-form-label"
for="email"
>
Email
</label>
<input
id="invitation_email"
type="email"
t-att-name="'invitation_email'"
t-attf-class="form-control "
t-att-value="invitation_email or checkin_partner.email"
/>
</div>
<div
t-attf-class="form-group col-2 m-4 p-3 align-self-center"
>
<a <a
id="btnInvitation" t-att-id="'btnResendInvitation' +str(checkin_partner.id)"
onclick="launchSnackBar()" onclick="show_invitation(this)"
t-att-class="' btn btn-secondary o_send_invitation_js'" t-att-class="' btn btn-secondary d-none'"
style="color:#fff;" style="color:#fff;"
>Send Invitation</a> >Resend Invitation
<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">
<label
id="label_firstname"
class="col-form-label"
for="invitation_firstname"
>
Name
</label>
<input
id="invitation_firstname"
type="text"
t-att-name="'invitation_firstname'"
t-attf-class="form-control"
t-att-value="firstname or (checkin_partner.firstname)"
/>
</div>
<div t-attf-class="form-group col-4">
<label
id="label_email"
class="col-form-label"
for="email"
>
Email
</label>
<input
id="invitation_email"
type="email"
t-att-name="'invitation_email'"
t-attf-class="form-control "
t-att-value="invitation_email or checkin_partner.email"
/>
</div>
<div
t-attf-class="form-group col-2 m-4 p-3 align-self-center"
>
<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>
</div>
</div> </div>
</div> </div>
</t> </t>
@@ -1162,10 +1172,10 @@
for="gender" for="gender"
>Gender</label> >Gender</label>
<div class="d-none"><p <div class="d-none"><p
id="genderId" id="genderId"
><t ><t
t-esc="checkin_partner.gender" t-esc="checkin_partner.gender"
/></p></div> /></p></div>
<select <select
class="form-control" class="form-control"
t-att-name="'gender-'+str(count)" t-att-name="'gender-'+str(count)"
@@ -1336,10 +1346,34 @@
} }
</style> </style>
<script> <script>
function launchSnackBar() { function launchSnackBar(element) {
var x = document.getElementById("snackbar"); var x = document.getElementById("snackbar");
x.className = "show"; x.className = "show";
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
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)
div_invitation.classList.add("d-none");
btn_show_invitation.classList.remove("d-none");
}
function show_invitation(element) {
var checkin_partner_id = element.firstChild.nextSibling.innerText
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");
} }
</script> </script>
<script> <script>
@@ -1385,7 +1419,6 @@
} }
}); });
}); });
</script> </script>
</template> </template>
</odoo> </odoo>