[FIX]pms: access portal precheckin

This commit is contained in:
Darío Lodeiros
2022-11-14 17:51:21 +01:00
parent 5ca48a0cf2
commit 6de69e01fb
2 changed files with 14 additions and 9 deletions

View File

@@ -416,15 +416,17 @@ 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._document_check_access( folio_sudo = self.sudo()._document_check_access(
"pms.folio", "pms.folio",
folio_id, folio_id,
access_token=access_token, access_token=access_token,
) )
except (AccessError, MissingError): except (AccessError, MissingError):
return request.redirect("/my") return request.redirect("/my")
web_url = request.env["ir.config_parameter"].search( web_url = (
[("key", "=", "web.base.url")] request.env["ir.config_parameter"]
.sudo()
.search([("key", "=", "web.base.url")])
) )
values = self._folio_get_page_view_values(folio_sudo, access_token, **kw) values = self._folio_get_page_view_values(folio_sudo, access_token, **kw)
values.update({"no_breadcrumbs": True, "error": {}, "web_url": web_url.value}) values.update({"no_breadcrumbs": True, "error": {}, "web_url": web_url.value})

View File

@@ -650,12 +650,12 @@
> your passage through reception will be much faster</strong>, being able to enjoy the comfort of your room right away. > your passage through reception will be much faster</strong>, being able to enjoy the comfort of your room right away.
</center> </center>
<div class="col-12" style="margin-top:40px;"> <div class="col-12" style="margin-top:40px;">
<form <a
role="button"
class="col-6 float-left" class="col-6 float-left"
style="margin-bottom:50px" style="margin-bottom:50px"
t-att-action="'/my/folios/'+str(folio.id)" t-att-href="folio.get_portal_url()"
> >
<button <button
type="submit" type="submit"
class="btn btn-primary" class="btn btn-primary"
@@ -664,7 +664,7 @@
<span class="fa fa-info" /> <span class="fa fa-info" />
Reservation Info Reservation Info
</button> </button>
</form> </a>
<form <form
class="col-6 float-right" class="col-6 float-right"
style="margin-bottom:50px" style="margin-bottom:50px"
@@ -704,7 +704,10 @@
<t t-if="len(folio.checkin_partner_ids) &gt; 1"> <t t-if="len(folio.checkin_partner_ids) &gt; 1">
<div> <div>
If you wish, you can share with the rest of the guests the access to their check-in so that they can fill it out. If you wish, you can share with the rest of the guests the access to their check-in so that they can fill it out.
<form t-att-action="'/my/folios/'+str(folio.id)+'/invitations'"> <a
role="button"
t-att-href="folio.get_portal_url(suffix='/invitations')"
>
<button <button
type="submit" type="submit"
class="btn btn-primary" class="btn btn-primary"
@@ -713,7 +716,7 @@
<span class="fa fa-share-square" /> <span class="fa fa-share-square" />
Send Invitations Send Invitations
</button> </button>
</form> </a>
</div> </div>
</t> </t>