mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX] pms: fix precheckin in portal
This commit is contained in:
committed by
Darío Lodeiros
parent
846213706c
commit
e3deb0e789
@@ -324,7 +324,14 @@ class PortalPrecheckin(CustomerPortal):
|
|||||||
)
|
)
|
||||||
except (AccessError, MissingError):
|
except (AccessError, MissingError):
|
||||||
return request.redirect("/my")
|
return request.redirect("/my")
|
||||||
checkin_partner = folio_sudo.checkin_partner_ids[0]
|
available_checkins = folio_sudo.checkin_partner_ids.filtered(
|
||||||
|
lambda c: c.state in ["dummy", "draft"]
|
||||||
|
)
|
||||||
|
checkin_partner = (
|
||||||
|
available_checkins[0]
|
||||||
|
if available_checkins
|
||||||
|
else folio_sudo.checkin_partner_ids[0]
|
||||||
|
)
|
||||||
values.update(
|
values.update(
|
||||||
{
|
{
|
||||||
"no_breadcrumbs": True,
|
"no_breadcrumbs": True,
|
||||||
@@ -371,7 +378,7 @@ class PortalPrecheckin(CustomerPortal):
|
|||||||
if error:
|
if error:
|
||||||
checkin_pos = checkin_pos - 1
|
checkin_pos = checkin_pos - 1
|
||||||
values.update({"checkin_pos": checkin_pos})
|
values.update({"checkin_pos": checkin_pos})
|
||||||
if checkin_pos == len(folio_id.checkin_partner_ids):
|
if checkin_pos == len(folio_id.checkin_partner_ids) or checkin_pos == -2:
|
||||||
values = {
|
values = {
|
||||||
"folio": folio_id,
|
"folio": folio_id,
|
||||||
"no_breadcrumbs": True,
|
"no_breadcrumbs": True,
|
||||||
@@ -389,21 +396,21 @@ class PortalPrecheckin(CustomerPortal):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
if checkin_pos >= 0:
|
if checkin_pos >= 0:
|
||||||
checkin_partner_id = folio_id.checkin_partner_ids[checkin_pos]
|
available_checkins = folio_id.checkin_partner_ids.filtered(
|
||||||
elif checkin_pos == -2:
|
lambda c: c.state in ["dummy", "draft"]
|
||||||
checkin_partner_id = request.env["pms.checkin.partner"].browse(
|
|
||||||
checkin_partner_id
|
|
||||||
)
|
)
|
||||||
elif checkin_pos == -1:
|
if available_checkins:
|
||||||
return
|
checkin_partner = available_checkins[0]
|
||||||
access_token = checkin_partner_id.access_token
|
else:
|
||||||
if not checkin_partner_id.access_token:
|
return request.render("pms.portal_not_checkin", values)
|
||||||
access_token = PortalMixin._portal_ensure_token(checkin_partner_id)
|
access_token = checkin_partner.access_token
|
||||||
|
if not checkin_partner.access_token:
|
||||||
|
access_token = PortalMixin._portal_ensure_token(checkin_partner)
|
||||||
values.update(
|
values.update(
|
||||||
self._precheckin_get_page_view_values(checkin_partner_id.id, access_token)
|
self._precheckin_get_page_view_values(checkin_partner.id, access_token)
|
||||||
)
|
)
|
||||||
values.update({"no_breadcrumbs": True})
|
values.update({"no_breadcrumbs": True})
|
||||||
if checkin_partner_id.state not in ["dummy", "draft"]:
|
if checkin_partner.state not in ["dummy", "draft"]:
|
||||||
return request.render("pms.portal_not_checkin", values)
|
return request.render("pms.portal_not_checkin", values)
|
||||||
return request.render("pms.portal_my_precheckin_detail", values)
|
return request.render("pms.portal_my_precheckin_detail", values)
|
||||||
|
|
||||||
@@ -416,7 +423,7 @@ class PortalPrecheckin(CustomerPortal):
|
|||||||
)
|
)
|
||||||
def portal_precheckin_invitation(self, folio_id, access_token=None, **kw):
|
def portal_precheckin_invitation(self, folio_id, access_token=None, **kw):
|
||||||
try:
|
try:
|
||||||
folio_sudo = self.sudo()._document_check_access(
|
folio_sudo = self._document_check_access(
|
||||||
"pms.folio",
|
"pms.folio",
|
||||||
folio_id,
|
folio_id,
|
||||||
access_token=access_token,
|
access_token=access_token,
|
||||||
@@ -463,6 +470,35 @@ class PortalPrecheckin(CustomerPortal):
|
|||||||
):
|
):
|
||||||
error[firstname] = "error"
|
error[firstname] = "error"
|
||||||
error_message[firstname] = "Firstname or any lastname are not included"
|
error_message[firstname] = "Firstname or any lastname are not included"
|
||||||
|
if not data.get("gender"):
|
||||||
|
error["gender"] = "error"
|
||||||
|
error_message["gender"] = "Gender is mandatory"
|
||||||
|
if not data.get("document_number"):
|
||||||
|
error["document_number"] = "error"
|
||||||
|
error_message["document_number"] = "Document number is mandatory"
|
||||||
|
if not data.get("document_type"):
|
||||||
|
error["document_type"] = "error"
|
||||||
|
error_message["document_type"] = "Document type is mandatory"
|
||||||
|
if not data.get("document_expedition_date"):
|
||||||
|
error["document_expedition_date"] = "error"
|
||||||
|
error_message[
|
||||||
|
"document_expedition_date"
|
||||||
|
] = "Document expedition date is mandatory"
|
||||||
|
if not data.get("birthdate_date"):
|
||||||
|
error["birthdate_date"] = "error"
|
||||||
|
error_message["birthdate_date"] = "Birth date is mandatory"
|
||||||
|
if not data.get("nationality_id"):
|
||||||
|
error["nationality_id"] = "error"
|
||||||
|
error_message["nationality_id"] = "Nationality is mandatory"
|
||||||
|
if (
|
||||||
|
not data.get("residence_street")
|
||||||
|
or not data.get("residence_city")
|
||||||
|
or not data.get("residence_zip")
|
||||||
|
or data.get("residence_country_id") == "placeholder"
|
||||||
|
or data.get("residence_state_id") == "placeholder"
|
||||||
|
):
|
||||||
|
error["address"] = "error"
|
||||||
|
error_message["address"] = "Address data is mandatory"
|
||||||
return error, error_message
|
return error, error_message
|
||||||
|
|
||||||
def form_document_validate(self, data, counter):
|
def form_document_validate(self, data, counter):
|
||||||
|
|||||||
@@ -470,12 +470,16 @@ class PmsCheckinPartner(models.Model):
|
|||||||
and record.document_number
|
and record.document_number
|
||||||
and record.document_type
|
and record.document_type
|
||||||
):
|
):
|
||||||
id_number_id = self.env["res.partner.id_number"].search(
|
id_number_id = (
|
||||||
[
|
self.sudo()
|
||||||
("partner_id", "=", record.partner_id.id),
|
.env["res.partner.id_number"]
|
||||||
("name", "=", record.document_number),
|
.search(
|
||||||
("category_id", "=", record.document_type.id),
|
[
|
||||||
]
|
("partner_id", "=", record.partner_id.id),
|
||||||
|
("name", "=", record.document_number),
|
||||||
|
("category_id", "=", record.document_type.id),
|
||||||
|
]
|
||||||
|
)
|
||||||
)
|
)
|
||||||
if not id_number_id:
|
if not id_number_id:
|
||||||
id_number_id = self.env["res.partner.id_number"].create(
|
id_number_id = self.env["res.partner.id_number"].create(
|
||||||
@@ -502,14 +506,20 @@ class PmsCheckinPartner(models.Model):
|
|||||||
for record in self:
|
for record in self:
|
||||||
if not record.partner_id:
|
if not record.partner_id:
|
||||||
if record.document_number and record.document_type:
|
if record.document_number and record.document_type:
|
||||||
number = self.env["res.partner.id_number"].search(
|
number = (
|
||||||
[
|
self.sudo()
|
||||||
("name", "=", record.document_number),
|
.env["res.partner.id_number"]
|
||||||
("category_id", "=", record.document_type.id),
|
.search(
|
||||||
]
|
[
|
||||||
|
("name", "=", record.document_number),
|
||||||
|
("category_id", "=", record.document_type.id),
|
||||||
|
]
|
||||||
|
)
|
||||||
)
|
)
|
||||||
partner = self.env["res.partner"].search(
|
partner = (
|
||||||
[("id", "=", number.partner_id.id)]
|
self.sudo()
|
||||||
|
.env["res.partner"]
|
||||||
|
.search([("id", "=", number.partner_id.id)])
|
||||||
)
|
)
|
||||||
if not partner:
|
if not partner:
|
||||||
if record.firstname or record.lastname or record.lastname2:
|
if record.firstname or record.lastname or record.lastname2:
|
||||||
@@ -774,8 +784,10 @@ class PmsCheckinPartner(models.Model):
|
|||||||
for checkin_dict in roomlist_json:
|
for checkin_dict in roomlist_json:
|
||||||
identifier = checkin_dict["identifier"]
|
identifier = checkin_dict["identifier"]
|
||||||
reservation_id = checkin_dict["reservation_id"]
|
reservation_id = checkin_dict["reservation_id"]
|
||||||
checkin = self.env["pms.checkin.partner"].search(
|
checkin = (
|
||||||
[("identifier", "=", identifier)]
|
self.sudo()
|
||||||
|
.env["pms.checkin.partner"]
|
||||||
|
.search([("identifier", "=", identifier)])
|
||||||
)
|
)
|
||||||
reservation = self.env["pms.reservation"].browse(reservation_id)
|
reservation = self.env["pms.reservation"].browse(reservation_id)
|
||||||
if not checkin:
|
if not checkin:
|
||||||
@@ -878,26 +890,25 @@ class PmsCheckinPartner(models.Model):
|
|||||||
if values.get("first"):
|
if values.get("first"):
|
||||||
values.pop("first")
|
values.pop("first")
|
||||||
if values.get("nationality_id"):
|
if values.get("nationality_id"):
|
||||||
nationality_id = self.env["res.country"].search(
|
values.update({"nationality_id": int(values.get("nationality_id"))})
|
||||||
[("id", "=", values.get("nationality_id"))]
|
|
||||||
)
|
|
||||||
values.update({"nationality_id": nationality_id.id})
|
|
||||||
else:
|
else:
|
||||||
values.update({"nationality_id": False})
|
values.update({"nationality_id": False})
|
||||||
if not values.get("document_type"):
|
if not values.get("document_type"):
|
||||||
values.update({"document_type": False})
|
values.update({"document_type": False})
|
||||||
else:
|
else:
|
||||||
doc_type_name = values.get("document_type")
|
doc_type_name = values.get("document_type")
|
||||||
doc_type = self.env["res.partner.id_category"].search(
|
doc_type = (
|
||||||
[("name", "=", doc_type_name)]
|
self.sudo()
|
||||||
|
.env["res.partner.id_category"]
|
||||||
|
.search([("name", "=", doc_type_name)])
|
||||||
)
|
)
|
||||||
values.update({"document_type": doc_type})
|
values.update({"document_type": doc_type.id})
|
||||||
if values.get("state"):
|
if values.get("residence_state_id"):
|
||||||
residence_state_id = self.env["res.country.state"].search(
|
values.update({"residence_state_id": int(values.get("residence_state_id"))})
|
||||||
[("id", "=", values.get("state"))]
|
if values.get("residence_country_id"):
|
||||||
|
values.update(
|
||||||
|
{"residence_country_id": int(values.get("residence_country_id"))}
|
||||||
)
|
)
|
||||||
values.update({"residence_state_id": residence_state_id})
|
|
||||||
values.pop("state")
|
|
||||||
if values.get("document_expedition_date"):
|
if values.get("document_expedition_date"):
|
||||||
doc_date = values.get("document_expedition_date")
|
doc_date = values.get("document_expedition_date")
|
||||||
birthdate = values.get("birthdate_date")
|
birthdate = values.get("birthdate_date")
|
||||||
@@ -911,7 +922,6 @@ class PmsCheckinPartner(models.Model):
|
|||||||
"document_expedition_date": document_expedition_date,
|
"document_expedition_date": document_expedition_date,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
checkin_partner.sudo().write(values)
|
checkin_partner.sudo().write(values)
|
||||||
|
|
||||||
def send_portal_invitation_email(self, invitation_firstname=None, email=None):
|
def send_portal_invitation_email(self, invitation_firstname=None, email=None):
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
name="lastname"
|
name="lastname"
|
||||||
t-attf-class="form-control"
|
t-attf-class="form-control #{error.get('firstname') and 'is-invalid' or ''}"
|
||||||
t-att-value="checkin_partner_id.lastname"
|
t-att-value="checkin_partner_id.lastname"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -84,11 +84,11 @@
|
|||||||
<label
|
<label
|
||||||
class="col-form-label"
|
class="col-form-label"
|
||||||
for="lastname2"
|
for="lastname2"
|
||||||
> Second Lastname</label>
|
> Second Lastname (Optional)</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
name="lastname2"
|
name="lastname2"
|
||||||
t-attf-class="form-control"
|
t-attf-class="form-control #{error.get('firstname') and 'is-invalid' or ''}"
|
||||||
t-att-value="checkin_partner_id.lastname2"
|
t-att-value="checkin_partner_id.lastname2"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -104,6 +104,7 @@
|
|||||||
class="form-control"
|
class="form-control"
|
||||||
name="gender"
|
name="gender"
|
||||||
t-att-value="checkin_partner_id.gender"
|
t-att-value="checkin_partner_id.gender"
|
||||||
|
t-attf-class="form-control #{error.get('gender') and 'is-invalid' or ''}"
|
||||||
>
|
>
|
||||||
<option value="">Select an option</option>
|
<option value="">Select an option</option>
|
||||||
<option
|
<option
|
||||||
@@ -125,10 +126,17 @@
|
|||||||
Other
|
Other
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
|
<t t-if="error_message">
|
||||||
|
<span
|
||||||
|
class="text-danger"
|
||||||
|
t-esc="error_message.get('gender')"
|
||||||
|
/>
|
||||||
|
</t>
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
|
<div
|
||||||
name="document_type_div"
|
name="document_type_div"
|
||||||
t-attf-class="form-group col-12 col-md-6"
|
t-attf-class="col-12 col-md-6"
|
||||||
>
|
>
|
||||||
<label
|
<label
|
||||||
class="col-form-label"
|
class="col-form-label"
|
||||||
@@ -159,7 +167,7 @@
|
|||||||
/>
|
/>
|
||||||
</t>
|
</t>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
name="document_number_div"
|
name="document_number_div"
|
||||||
t-attf-class="col-12 col-md-6"
|
t-attf-class="col-12 col-md-6"
|
||||||
>
|
>
|
||||||
@@ -180,6 +188,8 @@
|
|||||||
/>
|
/>
|
||||||
</t>
|
</t>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div t-attf-class="col-12 col-md-6">
|
<div t-attf-class="col-12 col-md-6">
|
||||||
<label
|
<label
|
||||||
class="col-form-label"
|
class="col-form-label"
|
||||||
@@ -227,7 +237,7 @@
|
|||||||
for="nationality_id"
|
for="nationality_id"
|
||||||
>Nationality</label>
|
>Nationality</label>
|
||||||
<select
|
<select
|
||||||
class="form-control"
|
t-attf-class="form-control #{error.get('nationality_id') and 'is-invalid' or ''}"
|
||||||
id="country"
|
id="country"
|
||||||
name='nationality_id'
|
name='nationality_id'
|
||||||
>
|
>
|
||||||
@@ -241,13 +251,19 @@
|
|||||||
</option>
|
</option>
|
||||||
</t>
|
</t>
|
||||||
</select>
|
</select>
|
||||||
|
<t t-if="error_message">
|
||||||
|
<span
|
||||||
|
class="text-danger"
|
||||||
|
t-esc="error_message.get('nationality_id')"
|
||||||
|
/>
|
||||||
|
</t>
|
||||||
</div>
|
</div>
|
||||||
<div t-attf-class="form-group col-12 col-md-6 pt-5">
|
<div t-attf-class="form-group col-12 col-md-6">
|
||||||
<label
|
<label
|
||||||
id="label_mobile"
|
id="label_mobile"
|
||||||
class="col-form-label"
|
class="col-form-label"
|
||||||
for="mobile"
|
for="mobile"
|
||||||
>Mobile</label>
|
>Mobile (Optional)</label>
|
||||||
<input
|
<input
|
||||||
type="phone"
|
type="phone"
|
||||||
name="mobile"
|
name="mobile"
|
||||||
@@ -261,16 +277,16 @@
|
|||||||
/>
|
/>
|
||||||
</t>
|
</t>
|
||||||
</div>
|
</div>
|
||||||
<div t-attf-class="form-group col-12 col-md-6 pt-md-5">
|
<div t-attf-class="form-group col-12 col-md-6">
|
||||||
<label
|
<label
|
||||||
id="label_phone"
|
id="label_phone"
|
||||||
class="col-form-label"
|
class="col-form-label"
|
||||||
for="phone"
|
for="phone"
|
||||||
>Phone</label>
|
>Phone (Optional)</label>
|
||||||
<input
|
<input
|
||||||
type="phone"
|
type="phone"
|
||||||
name="phone"
|
name="phone"
|
||||||
t-attf-class="form-control #{error.get('email') and 'is-invalid' or ''}"
|
t-attf-class="form-control #{error.get('phone') and 'is-invalid' or ''}"
|
||||||
t-att-value="checkin_partner_id.phone"
|
t-att-value="checkin_partner_id.phone"
|
||||||
/>
|
/>
|
||||||
<t t-if="error_message">
|
<t t-if="error_message">
|
||||||
@@ -285,7 +301,7 @@
|
|||||||
id="label_email"
|
id="label_email"
|
||||||
class="col-form-label"
|
class="col-form-label"
|
||||||
for="email"
|
for="email"
|
||||||
>Email</label>
|
>Email (Optional)</label>
|
||||||
<input
|
<input
|
||||||
type="email"
|
type="email"
|
||||||
name="email"
|
name="email"
|
||||||
@@ -299,19 +315,6 @@
|
|||||||
/>
|
/>
|
||||||
</t>
|
</t>
|
||||||
</div>
|
</div>
|
||||||
<div t-attf-class="form-group col-12 col-md-6 ">
|
|
||||||
<label
|
|
||||||
id="label_relationship"
|
|
||||||
class="col-form-label"
|
|
||||||
for="partner_relationship"
|
|
||||||
>Partner Relationship</label>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
name="partner_relationship"
|
|
||||||
t-attf-class="form-control #{error.get('email') and 'is-invalid' or ''}"
|
|
||||||
t-att-value="checkin_partner_id.partner_relationship"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div t-attf-class="form-group col-md-12 pt-md-5">
|
<div t-attf-class="form-group col-md-12 pt-md-5">
|
||||||
<label
|
<label
|
||||||
class="col-form-label"
|
class="col-form-label"
|
||||||
@@ -321,14 +324,14 @@
|
|||||||
type="text"
|
type="text"
|
||||||
placeholder="Street"
|
placeholder="Street"
|
||||||
name="residence_street"
|
name="residence_street"
|
||||||
t-attf-class="form-control #{error.get('email') and 'is-invalid' or ''}"
|
t-attf-class="form-control #{error.get('address') and 'is-invalid' or ''}"
|
||||||
t-att-value="checkin_partner_id.residence_street"
|
t-att-value="checkin_partner_id.residence_street"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div t-attf-class="form-group col-md-12">
|
<div t-attf-class="form-group col-md-12">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Second Street"
|
placeholder="Second Street (Optional)"
|
||||||
name="residence_street2"
|
name="residence_street2"
|
||||||
t-attf-class="form-control #{error.get('email') and 'is-invalid' or ''}"
|
t-attf-class="form-control #{error.get('email') and 'is-invalid' or ''}"
|
||||||
t-att-value="checkin_partner_id.residence_street2"
|
t-att-value="checkin_partner_id.residence_street2"
|
||||||
@@ -339,7 +342,7 @@
|
|||||||
type="text"
|
type="text"
|
||||||
placeholder="City"
|
placeholder="City"
|
||||||
name="residence_city"
|
name="residence_city"
|
||||||
t-attf-class="form-control #{error.get('email') and 'is-invalid' or ''}"
|
t-attf-class="form-control #{error.get('address') and 'is-invalid' or ''}"
|
||||||
t-att-value="checkin_partner_id.residence_city"
|
t-att-value="checkin_partner_id.residence_city"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -348,7 +351,7 @@
|
|||||||
type="text"
|
type="text"
|
||||||
placeholder="Zip"
|
placeholder="Zip"
|
||||||
name="residence_zip"
|
name="residence_zip"
|
||||||
t-attf-class="form-control #{error.get('email') and 'is-invalid' or ''}"
|
t-attf-class="form-control #{error.get('address') and 'is-invalid' or ''}"
|
||||||
t-att-value="checkin_partner_id.residence_zip"
|
t-att-value="checkin_partner_id.residence_zip"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -397,37 +400,21 @@
|
|||||||
</t>
|
</t>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<t t-if="checkin_pos >= 0">
|
<t t-if="error_message">
|
||||||
<div class="col-4">
|
<span
|
||||||
<t t-if="not error">
|
class="text-danger"
|
||||||
<button
|
t-esc="error_message.get('address')"
|
||||||
class="btn btn-primary"
|
/>
|
||||||
id="btnPrev1"
|
</t>
|
||||||
type="button"
|
<t>
|
||||||
>
|
|
||||||
<span class="fa fa-long-arrow-left" />
|
|
||||||
Prev
|
|
||||||
</button>
|
|
||||||
</t>
|
|
||||||
<t t-else="">
|
|
||||||
<button
|
|
||||||
class="btn btn-primary"
|
|
||||||
id="btnPrev2"
|
|
||||||
type="button"
|
|
||||||
onclick="history.go(-3)"
|
|
||||||
>
|
|
||||||
<span class="fa fa-long-arrow-left" />
|
|
||||||
Prev
|
|
||||||
</button>
|
|
||||||
</t>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="pager_count" class="col-4 pt-3">
|
<div id="pager_count" class="col-4 pt-3">
|
||||||
<center>
|
<center>
|
||||||
Page
|
Page
|
||||||
<span t-esc="int(checkin_pos) + 1" />
|
<span t-esc="int(checkin_pos) + 1" />
|
||||||
of
|
of
|
||||||
<span t-esc="len(folio.checkin_partner_ids)" />
|
<span
|
||||||
|
t-esc="len(folio.checkin_partner_ids.filtered(lambda c: c.state in ['dummy','draft']))"
|
||||||
|
/>
|
||||||
</center>
|
</center>
|
||||||
</div>
|
</div>
|
||||||
<t t-set="checkin_pos" t-value="checkin_pos+1" />
|
<t t-set="checkin_pos" t-value="checkin_pos+1" />
|
||||||
@@ -438,36 +425,16 @@
|
|||||||
class="d-none"
|
class="d-none"
|
||||||
t-att-value="checkin_pos"
|
t-att-value="checkin_pos"
|
||||||
/>
|
/>
|
||||||
<div class="col-4">
|
<div class="col-6">
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
class="btn btn-primary float-right"
|
class="btn btn-primary float-right"
|
||||||
>
|
>
|
||||||
Next
|
Save and Continue
|
||||||
<span class="fa fa-long-arrow-right" />
|
<span class="fa fa-long-arrow-right" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
<t t-else="">
|
|
||||||
<div class="col-12 mt-4">
|
|
||||||
<button
|
|
||||||
id="btnSave"
|
|
||||||
onclick="launchSnackBar(this)"
|
|
||||||
type="submit"
|
|
||||||
class="btn btn-primary float-right"
|
|
||||||
>
|
|
||||||
Save
|
|
||||||
</button>
|
|
||||||
<input
|
|
||||||
type="number"
|
|
||||||
name="checkin_pos"
|
|
||||||
id="input_checkin_pos"
|
|
||||||
class="d-none"
|
|
||||||
t-att-value="-1"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div id="snackbar">Data Saved Successfully </div>
|
|
||||||
</t>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -819,7 +786,6 @@
|
|||||||
class="' btn btn-secondary"
|
class="' btn btn-secondary"
|
||||||
t-att-href="'whatsapp://send?text='+web_url+checkin_partner.get_portal_url()"
|
t-att-href="'whatsapp://send?text='+web_url+checkin_partner.get_portal_url()"
|
||||||
style="color:#fff;margin-top:20px;"
|
style="color:#fff;margin-top:20px;"
|
||||||
t-attf-onclick="show_invitation(this)"
|
|
||||||
>
|
>
|
||||||
<span class="fa fa-whatsapp" />
|
<span class="fa fa-whatsapp" />
|
||||||
Send Whatsapp Invitation
|
Send Whatsapp Invitation
|
||||||
@@ -970,15 +936,7 @@
|
|||||||
if(name){
|
if(name){
|
||||||
host.innerHTML = name;
|
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_email = document.getElementById(btnId);
|
|
||||||
div_invitation.classList.add("d-none");
|
|
||||||
btn_show_invitation_email.classList.remove("d-none");
|
|
||||||
var x = document.getElementById("snackbar");
|
|
||||||
x.className = "show";
|
|
||||||
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -999,349 +957,13 @@
|
|||||||
</template>
|
</template>
|
||||||
<template id="portal_my_precheckin_end" name="Precheckin End">
|
<template id="portal_my_precheckin_end" name="Precheckin End">
|
||||||
<t t-call="portal.portal_layout">
|
<t t-call="portal.portal_layout">
|
||||||
<table>
|
<center>
|
||||||
<thead>
|
<h5 style="margin-top:20px;">
|
||||||
<center>
|
Thank you!
|
||||||
<h5 style="margin-top:20px;">
|
Your check-in has been successful.
|
||||||
Thank you,
|
</h5>
|
||||||
<span t-field="folio.sudo().partner_name" />.<br />
|
<br />
|
||||||
Your check-in has been successful.
|
</center>
|
||||||
</h5>
|
|
||||||
|
|
||||||
<br />
|
|
||||||
You can check if all the data has been saved correctly
|
|
||||||
<a
|
|
||||||
data-toggle="collapse"
|
|
||||||
href="#collapseExample"
|
|
||||||
aria-expanded="false"
|
|
||||||
aria-controls="collapseExample"
|
|
||||||
>here</a>
|
|
||||||
</center>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<table class="collapse mt-5" id="collapseExample">
|
|
||||||
<t t-foreach="folio.reservation_ids" t-as="reservation">
|
|
||||||
<thead style="background-color: #F5F5F5;">
|
|
||||||
<tr>
|
|
||||||
<td colspan="4">
|
|
||||||
<em class="font-weight-normal text-muted">
|
|
||||||
Room:
|
|
||||||
</em>
|
|
||||||
<a
|
|
||||||
t-att-title="reservation.sudo().room_type_id.name"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-esc="reservation.sudo().room_type_id.name"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<t
|
|
||||||
t-foreach="reservation.checkin_partner_ids"
|
|
||||||
t-as="checkin_partner"
|
|
||||||
>
|
|
||||||
<tbody style="background-color: white;">
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td colspan="4">
|
|
||||||
|
|
||||||
<div class="row col-12">
|
|
||||||
<div t-attf-class="d-none">
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
t-att-name="'checkin_partner_id'"
|
|
||||||
t-attf-class="form-control"
|
|
||||||
t-att-value="id or (checkin_partner.id)"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="row col-12 ml-0 mr-0 pt-2 pb-2"
|
|
||||||
style="background-color:#ececec"
|
|
||||||
/>
|
|
||||||
<div class="row o_portal_details">
|
|
||||||
<div class="col">
|
|
||||||
<div class="row mx-5 px-5">
|
|
||||||
<div
|
|
||||||
t-attf-class="form-group mt-3 col-12 col-md-6 font-weight-bold"
|
|
||||||
>
|
|
||||||
Name:
|
|
||||||
<br />
|
|
||||||
<span
|
|
||||||
class="font-weight-normal ml-3"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-esc="checkin_partner.firstname"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
t-attf-class="form-group mt-3 col-12 col-md-6 font-weight-bold"
|
|
||||||
>
|
|
||||||
Lastname:
|
|
||||||
<br />
|
|
||||||
<span
|
|
||||||
class="font-weight-normal ml-3"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-esc="checkin_partner.lastname"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
t-attf-class="form-group col-12 col-md-6 font-weight-bold"
|
|
||||||
>
|
|
||||||
Second Lastname:
|
|
||||||
<br />
|
|
||||||
<span
|
|
||||||
class="font-weight-normal ml-3"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-esc="checkin_partner.lastname2"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
t-attf-class="form-group col-12 col-md-6 font-weight-bold"
|
|
||||||
>
|
|
||||||
Gender:
|
|
||||||
<br />
|
|
||||||
<span
|
|
||||||
class="font-weight-normal ml-3"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-esc="checkin_partner.gender"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
t-attf-class="form-group col-12 col-md-6 font-weight-bold"
|
|
||||||
>
|
|
||||||
Doc. Type:
|
|
||||||
<br />
|
|
||||||
<span
|
|
||||||
class="font-weight-normal ml-3"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-esc="checkin_partner.document_type.name"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
t-attf-class="form-group col-12 col-md-6 font-weight-bold"
|
|
||||||
>
|
|
||||||
Doc. Number:
|
|
||||||
<br />
|
|
||||||
<span
|
|
||||||
class="font-weight-normal ml-3"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-esc="checkin_partner.document_number"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
t-attf-class="form-group col-12 col-md-6 font-weight-bold"
|
|
||||||
>
|
|
||||||
Doc. Expedition Date:
|
|
||||||
<br />
|
|
||||||
<span
|
|
||||||
class="font-weight-normal ml-3"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-esc="checkin_partner.document_expedition_date"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
name="birthdate_div"
|
|
||||||
t-attf-class="form-group col-12 col-md-6 font-weight-bold"
|
|
||||||
>
|
|
||||||
Birthdate:
|
|
||||||
<br />
|
|
||||||
<span
|
|
||||||
class="font-weight-normal ml-3"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-esc="checkin_partner.birthdate_date"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
t-attf-class="form-group col-12 col-md-6 font-weight-bold"
|
|
||||||
>
|
|
||||||
Mobile:
|
|
||||||
<br />
|
|
||||||
<span
|
|
||||||
class="font-weight-normal ml-3"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-esc="checkin_partner.mobile"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
t-attf-class="form-group col-12 col-md-6 font-weight-bold"
|
|
||||||
>
|
|
||||||
Phone:
|
|
||||||
<br />
|
|
||||||
<span
|
|
||||||
class="font-weight-normal ml-3"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-esc="checkin_partner.phone"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
t-attf-class="form-group col-12 col-md-6 font-weight-bold"
|
|
||||||
>
|
|
||||||
Email:
|
|
||||||
<br />
|
|
||||||
<span
|
|
||||||
class="font-weight-normal ml-3"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-esc="checkin_partner.email"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
t-attf-class="form-group col-12 col-md-6 font-weight-bold"
|
|
||||||
>
|
|
||||||
Nationality:
|
|
||||||
<br />
|
|
||||||
<span
|
|
||||||
class="font-weight-normal ml-3"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-esc="checkin_partner.nationality_id.name"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
t-attf-class="form-group col-12 col-md-6 font-weight-bold"
|
|
||||||
>
|
|
||||||
Partner Relationship:
|
|
||||||
<br />
|
|
||||||
<span
|
|
||||||
class="font-weight-normal ml-3"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-esc="checkin_partner.partner_relationship"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
t-attf-class="form-group col-12 mt-3 font-italic font-weight-bold"
|
|
||||||
>
|
|
||||||
Residence Address
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
t-attf-class="form-group col-12 col-md-6 font-weight-bold"
|
|
||||||
>
|
|
||||||
Street:
|
|
||||||
<br />
|
|
||||||
<span
|
|
||||||
class="font-weight-normal ml-3"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-esc="checkin_partner.residence_street"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
t-attf-class="form-group col-12 col-md-6 font-weight-bold"
|
|
||||||
>
|
|
||||||
Second Street:
|
|
||||||
<br />
|
|
||||||
<span
|
|
||||||
class="font-weight-normal ml-3"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-esc="checkin_partner.residence_street2"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
t-attf-class="form-group col-12 col-md-6 font-weight-bold"
|
|
||||||
>
|
|
||||||
City:
|
|
||||||
<br />
|
|
||||||
<span
|
|
||||||
class="font-weight-normal ml-3"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-esc="checkin_partner.residence_city"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
t-attf-class="form-group col-12 col-md-6 font-weight-bold"
|
|
||||||
>
|
|
||||||
ZIP:
|
|
||||||
<br />
|
|
||||||
<span
|
|
||||||
class="font-weight-normal ml-3"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-esc="checkin_partner.residence_zip"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
t-attf-class="form-group col-12 col-md-6 font-weight-bold"
|
|
||||||
>
|
|
||||||
State:
|
|
||||||
<br />
|
|
||||||
<span
|
|
||||||
class="font-weight-normal ml-3"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-set="residence_state_id"
|
|
||||||
t-value="int(checkin_partner.residence_state_id.id)"
|
|
||||||
/>
|
|
||||||
<t
|
|
||||||
t-set="residence_state"
|
|
||||||
t-value="folio.env['res.country.state'].browse(residence_state_id)"
|
|
||||||
/>
|
|
||||||
<t
|
|
||||||
t-esc="residence_state.name"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
t-attf-class="form-group col-12 col-md-6 font-weight-bold"
|
|
||||||
>
|
|
||||||
Country:
|
|
||||||
<br />
|
|
||||||
<span
|
|
||||||
class="font-weight-normal ml-3"
|
|
||||||
>
|
|
||||||
<t
|
|
||||||
t-set="residence_country_id"
|
|
||||||
t-value="int(checkin_partner.residence_country_id.id)"
|
|
||||||
/>
|
|
||||||
<t
|
|
||||||
t-set="residence_country"
|
|
||||||
t-value="folio.env['res.country'].browse(residence_country_id)"
|
|
||||||
/>
|
|
||||||
<t
|
|
||||||
t-esc="residence_country.name"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</t>
|
|
||||||
</t>
|
|
||||||
</table>
|
|
||||||
</table>
|
|
||||||
</t>
|
</t>
|
||||||
<style />
|
<style />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
inherit_id="pms.portal_my_precheckin_detail"
|
inherit_id="pms.portal_my_precheckin_detail"
|
||||||
>
|
>
|
||||||
<xpath expr="//div[@name='document_type_div']" position="replace">
|
<xpath expr="//div[@name='document_type_div']" position="replace">
|
||||||
<div t-attf-class="form-group col-md-4">
|
<div t-attf-class="form-group col-md-6">
|
||||||
<label class="col-form-label" for="document_type">Doc. Type</label>
|
<label class="col-form-label" for="document_type">Doc. Type</label>
|
||||||
<div class="d-none"><p id="docTypeId"><t
|
<div class="d-none"><p id="docTypeId"><t
|
||||||
t-esc="checkin_partner_id.document_type"
|
t-esc="checkin_partner_id.document_type"
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//div[@name='document_number_div']" position="replace">
|
<xpath expr="//div[@name='document_number_div']" position="replace">
|
||||||
<div t-attf-class="col-12 col-md-4">
|
<div t-attf-class="col-12 col-md-6">
|
||||||
<label class="col-form-label" for="document_number">Doc. Number</label>
|
<label class="col-form-label" for="document_number">Doc. Number</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
@@ -48,32 +48,6 @@
|
|||||||
/>
|
/>
|
||||||
</t>
|
</t>
|
||||||
</div>
|
</div>
|
||||||
<div t-attf-class="form-group col-md-4">
|
|
||||||
<label
|
|
||||||
class="col-form-label"
|
|
||||||
for="support_number"
|
|
||||||
>Doc. Support Number</label>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
name="support_number"
|
|
||||||
t-attf-class="form-control"
|
|
||||||
t-att-value="support_number or checkin_partner_id.support_number"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</xpath>
|
|
||||||
</template>
|
|
||||||
<template
|
|
||||||
id="inherit_pms_l10n_es_portal_my_precheckin_end"
|
|
||||||
inherit_id="pms.portal_my_precheckin_end"
|
|
||||||
>
|
|
||||||
<xpath expr="//div[@name='birthdate_div']" position="before">
|
|
||||||
<div t-attf-class="form-group col-12 col-md-6 font-weight-bold">
|
|
||||||
Doc. Support Number:
|
|
||||||
<br />
|
|
||||||
<span class="font-weight-normal ml-3">
|
|
||||||
<t t-esc="checkin_partner.support_number" />
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
Reference in New Issue
Block a user