Merge PR #73 into 14.0

Signed-off-by DarioLodeiros
This commit is contained in:
OCA-git-bot
2021-11-09 07:03:15 +00:00
5 changed files with 521 additions and 374 deletions

View File

@@ -752,6 +752,6 @@ class PortalPrecheckin(CustomerPortal):
) )
firstname = kw["firstname"] firstname = kw["firstname"]
email = kw["email"] email = kw["email"]
checkin_partner.write({"firstname": firstname, "email": email}) if firstname and email:
checkin_partner.send_portal_invitation_email(firstname, email) checkin_partner.write({"firstname": firstname, "email": email})
# request.portal_my_folio_precheckin(kw) checkin_partner.send_portal_invitation_email(firstname, email)

View File

@@ -163,6 +163,7 @@
</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
@@ -179,6 +180,52 @@
% 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%"

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]")
@@ -27,14 +28,40 @@ odoo.define("pms.SendInvitationData", function (require) {
.parent() .parent()
.find("input[name=invitation_email]") .find("input[name=invitation_email]")
.val(); .val();
this._rpc({ var error_firstname = $(ev.currentTarget)
route: "/my/precheckin/send_invitation", .parent()
params: { .parent()
checkin_partner_id: checkinPartnerId, .find("span:first");
firstname: firstname, var error_email = $(ev.currentTarget)
email: email, .parent()
}, .parent()
}); .find("input[name=invitation_email]")
.siblings("span");
console.log(error_firstname);
console.log(error_email);
if (firstname === "" || email === "") {
if (firstname === "") {
error_firstname.removeClass("d-none");
} else {
error_firstname.addClass("d-none");
}
if (email === "") {
error_email.removeClass("d-none");
} else {
error_email.addClass("d-none");
}
} else {
error_firstname.addClass("d-none");
error_email.addClass("d-none");
this._rpc({
route: "/my/precheckin/send_invitation",
params: {
checkin_partner_id: checkinPartnerId,
firstname: firstname,
email: email,
},
});
}
}, },
}); });
return publicWidget.registry.SendInvitationData; return publicWidget.registry.SendInvitationData;

View File

@@ -63,10 +63,6 @@
> >
<t t-esc="folio.name" /> <t t-esc="folio.name" />
</a> </a>
<a
t-att-href="folio.get_portal_url(suffix='/precheckin')"
t-att-title="Precheckin"
>Precheckin</a>
</td> </td>
<td><span t-field="folio.date_order" /></td> <td><span t-field="folio.date_order" /></td>
<td class="text-right"><span <td class="text-right"><span
@@ -213,14 +209,14 @@
<div t-call="pms.portal_folio_page_payment" /> <div t-call="pms.portal_folio_page_payment" />
</div> </div>
<div class="o_download_pdf btn-toolbar flex-sm-nowrap"> <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 <a
class="btn btn-secondary btn-block o_download_btn" class="btn btn-secondary btn-block o_download_btn"
t-att-href="folio.get_portal_url(report_type='pdf', download=True)" t-att-href="folio.get_portal_url(report_type='pdf', download=True)"
title="Download" title="Download"
><i class="fa fa-download" /> Download</a> ><i class="fa fa-download" /> Download</a>
</div> </div>
<div class="btn-group flex-grow-1 mb-1"> <div class="btn-group mb-1">
<a <a
class="btn btn-secondary btn-block o_print_btn o_portal_invoice_print" class="btn btn-secondary btn-block o_print_btn o_portal_invoice_print"
t-att-href="folio.get_portal_url(report_type='pdf')" t-att-href="folio.get_portal_url(report_type='pdf')"
@@ -230,6 +226,15 @@
><i class="fa fa-print" /> Print</a> ><i class="fa fa-print" /> Print</a>
</div> </div>
</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>
<li <li

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-11 col-md-8 row pt-5">
<div t-attf-class="form-group col-xl-4 pb-xl-5 pt-xl-5"> <div t-attf-class="form-group col-12 col-md-6">
<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="col-12 col-md-6">
<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-12 col-md-6 pb-md-5">
<label <label
class="col-form-label" class="col-form-label"
for="lastname2" for="lastname2"
@@ -61,126 +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="col-12 col-md-6 pb-5">
<label
class="col-form-label"
for="document_type"
>Doc. Type</label>
<select
class="form-control #{error.get('document_type') and 'is-invalid' or ''}"
name='document_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.id == checkin_partner.document_type.id"
>
<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 t-attf-class="form-group col-xl-4">
<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="doc_number or checkin_partner.document_number"
/>
<t t-if="error_message">
<span
class="text-danger"
t-esc="error_message.get('document_number')"
/>
</t>
</div>
<div t-attf-class="form-group col-xl-4">
<label
class="col-form-label"
for="document_expedition_date"
>Doc. Expedition Date/Doc. Validity Date</label>
<span
class="fa fa-question-circle fa-lg"
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."
style="margin-left: 70px;"
/>
<input
type="date"
name="document_expedition_date"
t-attf-class="form-control #{error.get('document_expedition_date') and 'is-invalid' or ''}"
t-att-value="doc_exp_date or checkin_partner.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-xl-4 pb-xl-5">
<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="birth_date or checkin_partner.birthdate_date"
/>
<t t-if="error_message">
<span
class="text-danger"
t-esc="error_message.get('birthdate_date')"
/>
</t>
</div>
<div t-attf-class="form-group col-xl-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"
@@ -214,7 +95,92 @@
</option> </option>
</select> </select>
</div> </div>
<div t-attf-class="form-group col-xl-4"> <div t-attf-class="form-group col-12 col-md-6">
<label
class="col-form-label"
for="document_type"
>Doc. Type</label>
<select
class="form-control #{error.get('document_type') and 'is-invalid' or ''}"
name='document_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.id == checkin_partner.document_type.id"
>
<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 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="doc_number or checkin_partner.document_number"
/>
<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="doc_exp_date or checkin_partner.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="birth_date or checkin_partner.birthdate_date"
/>
<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 <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-12 col-md-6">
<label <label
class="col-form-label" class="col-form-label"
for="state" for="state"
@@ -253,15 +219,51 @@
</t> </t>
</select> </select>
</div> </div>
<div t-attf-class="form-group col-12 col-md-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-12 col-md-6 pt-md-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>
@@ -327,38 +329,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"
@@ -854,6 +856,7 @@
<td colspan="4"> <td colspan="4">
<t t-if="not checkin_partner.firstname"> <t t-if="not checkin_partner.firstname">
<a <a
t-att-id="'host_name'+str(checkin_partner.id)"
name="url_acess_token" name="url_acess_token"
t-att-href="checkin_partner.get_portal_url()" t-att-href="checkin_partner.get_portal_url()"
> >
@@ -866,17 +869,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 +882,93 @@
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
id="label_firstname" t-att-id="'btn_show_invitation'+str(checkin_partner.id)"
class="col-form-label" class="btn btn-secondary"
for="invitation_firstname" style="color:#fff;margin-top:20px;"
t-attf-onclick="show_invitation(this)"
> >
Name <span
</label> t-esc="checkin_partner.id"
<input class="d-none"
id="invitation_firstname" />
type="text" Send Invitation
t-att-name="'invitation_firstname'" </a>
t-attf-class="form-control" <a
t-att-value="firstname or (checkin_partner.firstname)" t-att-id="'btnResendInvitation' +str(checkin_partner.id)"
/> onclick="show_invitation(this)"
</div> t-att-class="' btn btn-secondary d-none'"
<div t-attf-class="form-group col-4"> style="color:#fff;margin-top:20px;"
<label >Resend Invitation
id="label_email" <span
class="col-form-label" t-esc="checkin_partner.id"
for="email" class="d-none"
> /></a>
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>
<div <div
t-attf-class="form-group col-2 m-4 p-3 align-self-center" class="row col-12 d-none"
t-att-id="'invitation_group'+str(checkin_partner.id)"
> >
<a <div
id="btnInvitation" t-attf-class="form-group col-4 p-2"
onclick="launchSnackBar()" >
t-att-class="' btn btn-secondary o_send_invitation_js'" <label
style="color:#fff;" id="label_firstname"
>Send Invitation</a> class="col-form-label"
for="invitation_firstname"
>
Name
</label>
<input
t-att-id="'invitation_firstname'+str(checkin_partner.id)"
type="text"
t-att-name="'invitation_firstname'"
t-attf-class="form-control"
t-att-value="firstname or (checkin_partner.firstname)"
/>
<span
style="color:red"
class="d-none"
t-att-id="error_inv_firstname"
>Mandatory Firstname</span>
</div>
<div
t-attf-class="form-group col-4 p-2"
>
<label
id="label_email"
class="col-form-label"
for="email"
>
Email
</label>
<input
t-att-id="'invitation_email'+str(checkin_partner.id)"
type="email"
t-att-name="'invitation_email'"
t-attf-class="form-control "
t-att-value="invitation_email or checkin_partner.email"
/>
<span
style="color:red"
class="d-none error_inv_email"
>Mandatory Email</span>
</div>
<div
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 mt-4 p-2'"
style="color:#fff; height:36px;"
>
Send Invitation<span
t-esc="checkin_partner.id"
class="d-none"
/></a>
</div>
</div> </div>
</div> </div>
</t> </t>
@@ -949,9 +993,7 @@
<div class="row o_portal_details"> <div class="row o_portal_details">
<div class="row collapse" t-att-id="id1"> <div class="row collapse" t-att-id="id1">
<div class="row o_portal_details"> <div class="row o_portal_details">
<div <div t-attf-class="d-none">
t-attf-class="form-group col-xl-6 d-none"
>
<input <input
type="text" type="text"
t-att-name="'id-'+ str(count)" t-att-name="'id-'+ str(count)"
@@ -960,14 +1002,10 @@
/> />
</div> </div>
<div <div class="col">
class="col-xl-12 col-lg-8 mx-auto" <div class="row mx-5 px-5">
>
<div
class="row col-xl-12 col-lg-8 mx-auto"
>
<div <div
t-attf-class="form-group col-xl-4 pb-xl-5 pt-xl-5" t-attf-class="form-group col-12 col-md-6"
> >
<label <label
class="col-form-label" class="col-form-label"
@@ -987,7 +1025,7 @@
</t> </t>
</div> </div>
<div <div
t-attf-class="form-group col-xl-4 pt-xl-5" t-attf-class="form-group col-12 col-md-6"
> >
<label <label
class="col-form-label" class="col-form-label"
@@ -1001,7 +1039,7 @@
/> />
</div> </div>
<div <div
t-attf-class="form-group col-xl-4 pt-xl-5" t-attf-class="form-group col-12 col-md-6 pb-md-5"
> >
<label <label
class="col-form-label" class="col-form-label"
@@ -1015,147 +1053,7 @@
/> />
</div> </div>
<div <div
t-attf-class="form-group col-xl-4 pb-xl-5" t-attf-class="form-group col-12 col-md-6 pb-5"
>
<label
class="col-form-label"
for="document_type"
>Doc. Type</label>
<select
class="form-control #{error.get('document_type-'+str(count)) and 'is-invalid' or ''}"
t-att-name="'document_type-'+str(count)"
>
<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.id == checkin_partner.document_type.id"
>
<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-'+str(count))"
/>
</t>
</div>
<div
t-attf-class="form-group col-xl-4"
>
<label
class="col-form-label"
for="document_number"
>Doc. Number</label>
<input
type="text"
t-att-name="'document_number-'+str(count)"
t-attf-class="form-control #{error.get('document_number-'+str(count)) and 'is-invalid' or ''}"
t-att-value="doc_number or checkin_partner.document_number"
/>
<t t-if="error_message">
<span
class="text-danger"
t-esc="error_message.get('document_number-'+str(count))"
/>
</t>
</div>
<div
t-attf-class="form-group col-xl-4"
>
<label
class="col-form-label"
for="document_expedition_date"
>Doc. Expedition Date/Doc. Validity Date</label>
<span
class="fa fa-question-circle fa-lg"
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"
t-att-name="'document_expedition_date-'+ str(count)"
t-attf-class="form-control #{error.get('document_expedition_date-'+ str(count)) and 'is-invalid' or ''}"
t-att-value="doc_exp_date or checkin_partner.document_expedition_date"
/>
<t t-if="error_message">
<span
class="text-danger"
t-esc="error_message.get('document_expedition_date-'+ str(count))"
/>
</t>
</div>
<div
t-attf-class="form-group col-xl-4 pb-xl-5"
>
<label
class="col-form-label"
for="birthdate_date"
> Birth Date</label>
<input
type="date"
t-att-name="'birthdate_date-'+str(count)"
t-attf-class="form-control #{error.get('birthdate_date-'+str(count)) and 'is-invalid' or ''}"
t-att-value="birth_date or checkin_partner.birthdate_date"
/>
<t t-if="error_message">
<span
class="text-danger"
t-esc="error_message.get('birthdate_date-'+str(count))"
/>
</t>
</div>
<div
t-attf-class="form-group col-xl-4"
>
<label
class="col-form-label"
for="mobile"
>Mobile</label>
<input
type="phone"
t-att-name="'mobile-'+str(count)"
t-attf-class="form-control #{error.get('mobile-'+str(count)) 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-'+str(count))"
/>
</t>
</div>
<div
t-attf-class="form-group col-xl-4"
>
<label
class="col-form-label"
for="email"
>Email</label>
<input
type="email"
t-att-name="'email-'+str(count)"
t-attf-class="form-control #{error.get('email-'+str(count)) 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-'+str(count))"
/>
</t>
</div>
<div
t-attf-class="form-group col-xl-4 pb-xl-5"
> >
<label <label
class="col-form-label" class="col-form-label"
@@ -1195,7 +1093,148 @@
</select> </select>
</div> </div>
<div <div
t-attf-class="form-group col-xl-4" t-attf-class="form-group col-12 col-md-6"
>
<label
class="col-form-label"
for="document_type"
>Doc. Type</label>
<select
class="form-control #{error.get('document_type-'+str(count)) and 'is-invalid' or ''}"
t-att-name="'document_type-'+str(count)"
>
<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.id == checkin_partner.document_type.id"
>
<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-'+str(count))"
/>
</t>
</div>
<div
t-attf-class="form-group col-12 col-md-6"
>
<label
class="col-form-label"
for="document_number"
>Doc. Number</label>
<input
type="text"
t-att-name="'document_number-'+str(count)"
t-attf-class="form-control #{error.get('document_number-'+str(count)) and 'is-invalid' or ''}"
t-att-value="doc_number or checkin_partner.document_number"
/>
<t t-if="error_message">
<span
class="text-danger"
t-esc="error_message.get('document_number-'+str(count))"
/>
</t>
</div>
<div
t-attf-class="form-group 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"
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"
t-att-name="'document_expedition_date-'+ str(count)"
t-attf-class="form-control #{error.get('document_expedition_date-'+ str(count)) and 'is-invalid' or ''}"
t-att-value="doc_exp_date or checkin_partner.document_expedition_date"
/>
<t t-if="error_message">
<span
class="text-danger"
t-esc="error_message.get('document_expedition_date-'+ str(count))"
/>
</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"
t-att-name="'birthdate_date-'+str(count)"
t-attf-class="form-control #{error.get('birthdate_date-'+str(count)) and 'is-invalid' or ''}"
t-att-value="birth_date or checkin_partner.birthdate_date"
/>
<t t-if="error_message">
<span
class="text-danger"
t-esc="error_message.get('birthdate_date-'+str(count))"
/>
</t>
</div>
<div
t-attf-class="form-group col-12 col-md-6 pt-5"
>
<label
class="col-form-label"
for="mobile"
>Mobile</label>
<input
type="phone"
t-att-name="'mobile-'+str(count)"
t-attf-class="form-control #{error.get('mobile-'+str(count)) 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-'+str(count))"
/>
</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>
<input
type="email"
t-att-name="'email-'+str(count)"
t-attf-class="form-control #{error.get('email-'+str(count)) 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-'+str(count))"
/>
</t>
</div>
<div
t-attf-class="form-group col-12 col-md-6"
> >
<label <label
class="col-form-label" class="col-form-label"
@@ -1225,7 +1264,7 @@
</select> </select>
</div> </div>
<div <div
class="form-group col-xl-4" class="form-group col-12 col-md-6"
> >
<label <label
class="col-form-label" class="col-form-label"
@@ -1260,7 +1299,6 @@
</div> </div>
</div> </div>
</div> </div>
</td> </td>
</tr> </tr>
</t> </t>
@@ -1336,13 +1374,46 @@
} }
</style> </style>
<script> <script>
function launchSnackBar() { function launchSnackBar(element) {
var checkin_partner_id = element.firstChild.nextSibling.innerText
var inputEmailId = "invitation_email" + checkin_partner_id;
var email = document.getElementById(inputEmailId).value;
var nameId = "invitation_firstname" + checkin_partner_id;
var hostId = "host_name" + checkin_partner_id;
var host = document.getElementById(hostId);
var name = document.getElementById(nameId).value;
if(email){
if(name){
console.log("non ten email");
host.innerHTML = name;
var divId = "invitation_group" + checkin_partner_id;
var btnId = "btnResendInvitation" + checkin_partner_id;
var div_invitation = document.getElementById(divId);
var btn_show_invitation = document.getElementById(btnId);
div_invitation.classList.add("d-none");
btn_show_invitation.classList.remove("d-none");
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);
} }
</script> }
<script> }
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;
var div_invitation = document.getElementById(divId);
var btn_show_invitation = document.getElementById(btnId);
var btn_resend = document.getElementById(btn2);
div_invitation.classList.remove("d-none");
btn_show_invitation.classList.add("d-none");
btn_resend.classList.add("d-none");
}
let listaElementos = document.getElementsByClassName("fa-sm"); let listaElementos = document.getElementsByClassName("fa-sm");
for(i=0; i&lt;listaElementos.length; i++){ for(i=0; i&lt;listaElementos.length; i++){
let element =document.getElementById(i+1) let element =document.getElementById(i+1)
@@ -1371,8 +1442,6 @@
} }
} }
} }
</script>
<script>
let select_country = document.getElementById('country') let select_country = document.getElementById('country')
select_country.addEventListener("change", () => { select_country.addEventListener("change", () => {
@@ -1385,7 +1454,6 @@
} }
}); });
}); });
</script> </script>
</template> </template>
</odoo> </odoo>