mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP]precheckin folio: change buttons in checkin rows for one button that submit all field values
This commit is contained in:
@@ -307,10 +307,31 @@ class PortalPrecheckin(CustomerPortal):
|
|||||||
def portal_precheckin_submit(self, **kw):
|
def portal_precheckin_submit(self, **kw):
|
||||||
checkin_partner = request.env["pms.checkin.partner"].browse(int(kw.get("id")))
|
checkin_partner = request.env["pms.checkin.partner"].browse(int(kw.get("id")))
|
||||||
checkin_partner.write(kw)
|
checkin_partner.write(kw)
|
||||||
reservation = request.env["pms.reservation"].browse(
|
|
||||||
checkin_partner.reservation_id
|
@http.route(
|
||||||
)
|
["/my/precheckin/folio"], type="http", auth="user", website=False, csrf=True
|
||||||
values = {
|
)
|
||||||
"reservation": reservation.id,
|
def portal_precheckin_folio_submit(self, **kw):
|
||||||
}
|
counter = 2
|
||||||
return request.render("pms.portal_my_reservation_precheckin", values)
|
folio = request.env["pms.folio"].browse(int(kw.get("folio_id")))
|
||||||
|
checkin_partners = len(folio.checkin_partner_ids)
|
||||||
|
for _checkin in range(checkin_partners):
|
||||||
|
values = {
|
||||||
|
"firstname": kw["firstname-" + str(counter)],
|
||||||
|
"lastname": kw["lastname-" + str(counter)],
|
||||||
|
"lastname2": kw["lastname2-" + str(counter)],
|
||||||
|
"gender": kw["gender-" + str(counter)],
|
||||||
|
"document_type": kw["document_type-" + str(counter)],
|
||||||
|
"document_number": kw["document_number-" + str(counter)],
|
||||||
|
"document_expedition_date": kw[
|
||||||
|
"document_expedition_date-" + str(counter)
|
||||||
|
],
|
||||||
|
"mobile": kw["mobile-" + str(counter)],
|
||||||
|
"email": kw["email-" + str(counter)],
|
||||||
|
}
|
||||||
|
checkin_partner_id = int(kw.get("id-" + str(counter)))
|
||||||
|
checkin_partner = request.env["pms.checkin.partner"].browse(
|
||||||
|
checkin_partner_id
|
||||||
|
)
|
||||||
|
checkin_partner.write(values)
|
||||||
|
counter = counter + 1
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<form action="/my/precheckin" method="post">
|
<form action="/my/precheckin" method="post">
|
||||||
<div class="row o_portal_details">
|
<div class="row o_portal_details">
|
||||||
<div t-attf-class="form-group col-xl-6 d-none">
|
<div t-attf-class="form-group col-xl-6 d-none">
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
name="id"
|
name="id"
|
||||||
t-attf-class="form-control"
|
t-attf-class="form-control"
|
||||||
@@ -73,6 +73,7 @@
|
|||||||
class="form-control"
|
class="form-control"
|
||||||
id="gender"
|
id="gender"
|
||||||
name="gender"
|
name="gender"
|
||||||
|
t-att-value="gender or checkin_partner.gender"
|
||||||
>
|
>
|
||||||
<option value="female">Female</option>
|
<option value="female">Female</option>
|
||||||
<option value="male">Male</option>
|
<option value="male">Male</option>
|
||||||
@@ -88,6 +89,7 @@
|
|||||||
class="form-control"
|
class="form-control"
|
||||||
id="doc_type_id"
|
id="doc_type_id"
|
||||||
name="document_type"
|
name="document_type"
|
||||||
|
t-att-value="document_type or checkin_partner.document_type"
|
||||||
>
|
>
|
||||||
<option value="D">DNI</option>
|
<option value="D">DNI</option>
|
||||||
<option value="C">Driving License</option>
|
<option value="C">Driving License</option>
|
||||||
@@ -186,7 +188,7 @@
|
|||||||
<t t-set="id2" t-value="'#'" />
|
<t t-set="id2" t-value="'#'" />
|
||||||
<t t-set="id3" t-value="str(id2)+str(id1)" />
|
<t t-set="id3" t-value="str(id2)+str(id1)" />
|
||||||
<t t-set="count" t-value="count+1" />
|
<t t-set="count" t-value="count+1" />
|
||||||
<form class="collapse" action="/my/reservations/precheckin">
|
<form class="collapse" action="/my/precheckin">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4">
|
<td colspan="4">
|
||||||
<a t-att-href="checkin_partner.get_portal_url()">
|
<a t-att-href="checkin_partner.get_portal_url()">
|
||||||
@@ -258,6 +260,7 @@
|
|||||||
class="form-control"
|
class="form-control"
|
||||||
id="gender"
|
id="gender"
|
||||||
name="gender"
|
name="gender"
|
||||||
|
t-att-value="gender or checkin_partner.gender"
|
||||||
>
|
>
|
||||||
<option
|
<option
|
||||||
value="female"
|
value="female"
|
||||||
@@ -279,6 +282,7 @@
|
|||||||
class="form-control"
|
class="form-control"
|
||||||
id="doc_type_id"
|
id="doc_type_id"
|
||||||
name="document_type"
|
name="document_type"
|
||||||
|
t-att-value="document_type or checkin_partner.document_type"
|
||||||
>
|
>
|
||||||
<option value="D">DNI</option>
|
<option value="D">DNI</option>
|
||||||
<option
|
<option
|
||||||
@@ -364,6 +368,7 @@
|
|||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
class="btn btn-primary float-right mb32 "
|
class="btn btn-primary float-right mb32 "
|
||||||
|
confirm="Are you sure you want to do this?"
|
||||||
>
|
>
|
||||||
Confirm
|
Confirm
|
||||||
<span class="fa fa-long-arrow-right" />
|
<span class="fa fa-long-arrow-right" />
|
||||||
@@ -399,216 +404,255 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<t t-foreach="folio.reservation_ids" t-as="reservation">
|
<t t-set="count" t-value="1" />
|
||||||
<tr class="bg-light">
|
<form class="collapse" action="/my/precheckin/folio" method="get">
|
||||||
<td colspan="4"><em
|
<t t-foreach="folio.reservation_ids" t-as="reservation">
|
||||||
class="font-weight-normal text-muted"
|
<tr class="bg-light">
|
||||||
><span />Reservation: </em>
|
<td colspan="4"><em
|
||||||
<a
|
class="font-weight-normal text-muted"
|
||||||
t-att-href="reservation.get_portal_url(suffix='/precheckin')"
|
><span />Reservation: </em>
|
||||||
t-att-title="reservation.name"
|
<a
|
||||||
>
|
t-att-href="reservation.get_portal_url(suffix='/precheckin')"
|
||||||
<t t-esc="reservation.name" />
|
t-att-title="reservation.name"
|
||||||
</a>
|
>
|
||||||
</td>
|
<t t-esc="reservation.name" />
|
||||||
</tr>
|
</a>
|
||||||
<t t-set="count" t-value="1" />
|
</td>
|
||||||
<t
|
</tr>
|
||||||
t-foreach="reservation.checkin_partner_ids"
|
<t
|
||||||
t-as="checkin_partner"
|
t-foreach="reservation.checkin_partner_ids"
|
||||||
>
|
t-as="checkin_partner"
|
||||||
<t t-set="id1" t-value="'counter'+ str(count)" />
|
>
|
||||||
<t t-set="id2" t-value="'#'" />
|
<t t-set="id1" t-value="'counter'+ str(count)" />
|
||||||
<t t-set="id3" t-value="str(id2)+str(id1)" />
|
<t t-set="id2" t-value="'#'" />
|
||||||
<t t-set="count" t-value="count+1" />
|
<t t-set="id3" t-value="id2+id1" />
|
||||||
<form class="collapse" action="/my/precheckin">
|
<t t-set="idcheckin" t-value="'checkin' + str(count)" />
|
||||||
<tr>
|
<t t-set="count" t-value="count+1" />
|
||||||
<td colspan="4">
|
|
||||||
<a t-att-href="checkin_partner.get_portal_url()">
|
<tr>
|
||||||
Checkin
|
<td colspan="4">
|
||||||
</a>
|
<a t-att-href="checkin_partner.get_portal_url()">
|
||||||
<button
|
Checkin
|
||||||
|
</a>
|
||||||
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="btn btn-info"
|
class="btn btn-info"
|
||||||
data-toggle="collapse"
|
data-toggle="collapse"
|
||||||
t-att-data-target="id3"
|
t-att-data-target="id3"
|
||||||
>Drop down</button>
|
>Drop down</button>
|
||||||
<div class="row o_portal_details">
|
<div class="row o_portal_details">
|
||||||
<div class="col-lg-8">
|
<div class="col-lg-8">
|
||||||
<div class="row collapse" t-att-id="id1">
|
<div
|
||||||
<div t-attf-class="form-group col-xl-6">
|
class="row collapse"
|
||||||
<label
|
t-att-id="id1"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
t-attf-class="form-group col-xl-6"
|
||||||
|
>
|
||||||
|
<label
|
||||||
class="col-form-label"
|
class="col-form-label"
|
||||||
for="firstname"
|
for="firstname"
|
||||||
>Name</label>
|
>Name</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
name="firstname"
|
t-att-name="'firstname-' + str(count)"
|
||||||
t-attf-class="form-control"
|
t-attf-class="form-control"
|
||||||
t-att-value="firstname or checkin_partner.firstname"
|
t-att-value="firstname or checkin_partner.firstname"
|
||||||
|
t-att-id="idcheckin"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div t-attf-class="form-group col-xl-6">
|
<div
|
||||||
<label
|
t-attf-class="form-group col-xl-6"
|
||||||
|
>
|
||||||
|
<label
|
||||||
class="col-form-label"
|
class="col-form-label"
|
||||||
for="lastname"
|
for="lastname"
|
||||||
>Lastname</label>
|
>Lastname</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
name="lastname"
|
t-att-name="'lastname-' + str(count)"
|
||||||
t-attf-class="form-control"
|
t-attf-class="form-control"
|
||||||
t-att-value="lastname or checkin_partner.lastname"
|
t-att-value="lastname or checkin_partner.lastname"
|
||||||
|
t-att-id="idcheckin"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div t-attf-class="form-group col-xl-6">
|
<div
|
||||||
<label
|
t-attf-class="form-group col-xl-6"
|
||||||
|
>
|
||||||
|
<label
|
||||||
class="col-form-label"
|
class="col-form-label"
|
||||||
for="lastname2"
|
for="lastname2"
|
||||||
> Second Lastname</label>
|
> Second Lastname</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
name="lastname2"
|
t-att-name="'lastname2-' + str(count)"
|
||||||
t-attf-class="form-control"
|
t-attf-class="form-control"
|
||||||
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-6">
|
<div
|
||||||
<label
|
t-attf-class="form-group col-xl-6"
|
||||||
|
>
|
||||||
|
<label
|
||||||
class="col-form-label"
|
class="col-form-label"
|
||||||
for="birthdate_date"
|
for="birthdate_date"
|
||||||
> Birth Date</label>
|
> Birth Date</label>
|
||||||
<input
|
<input
|
||||||
type="date"
|
type="date"
|
||||||
name="birthdate_date"
|
t_att_name="'birthdate_date-'+ str(count)"
|
||||||
t-attf-class="form-control"
|
t-attf-class="form-control"
|
||||||
t-att-value="birth_date or checkin_partner.birthdate_date"
|
t-att-value="birth_date or checkin_partner.birthdate_date"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div t-attf-class="form-group col-xl-6">
|
<div
|
||||||
<label
|
t-attf-class="form-group col-xl-6"
|
||||||
|
>
|
||||||
|
<label
|
||||||
class="col-form-label"
|
class="col-form-label"
|
||||||
for="gender"
|
for="gender"
|
||||||
>Gender</label>
|
>Gender</label>
|
||||||
<select
|
<select
|
||||||
class="form-control"
|
class="form-control"
|
||||||
id="gender"
|
id="gender"
|
||||||
name="gender"
|
t-att-name="'gender-'+ str(count)"
|
||||||
|
t-att-value="gender or checkin_partner.gender"
|
||||||
>
|
>
|
||||||
<option
|
<option
|
||||||
value="female"
|
value="female"
|
||||||
>Female</option>
|
>Female</option>
|
||||||
<option
|
<option
|
||||||
value="male"
|
value="male"
|
||||||
>Male</option>
|
>Male</option>
|
||||||
<option
|
<option
|
||||||
value="other"
|
value="other"
|
||||||
>Other</option>
|
>Other</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div t-attf-class="form-group col-xl-6">
|
<div
|
||||||
<label
|
t-attf-class="form-group col-xl-6"
|
||||||
|
>
|
||||||
|
<label
|
||||||
class="col-form-label"
|
class="col-form-label"
|
||||||
for="document_type"
|
for="document_type"
|
||||||
>Doc. type</label>
|
>Doc. type</label>
|
||||||
<select
|
<select
|
||||||
class="form-control"
|
class="form-control"
|
||||||
id="doc_type_id"
|
id="doc_type_id"
|
||||||
name="document_type"
|
t-att-name="'document_type-'+ str(count)"
|
||||||
|
t-att-value="document_type or checkin_partner.document_type"
|
||||||
>
|
>
|
||||||
<option value="D">DNI</option>
|
<option
|
||||||
<option
|
value="D"
|
||||||
|
>DNI</option>
|
||||||
|
<option
|
||||||
value="C"
|
value="C"
|
||||||
>Driving License</option>
|
>Driving License</option>
|
||||||
<option
|
<option
|
||||||
value="I"
|
value="I"
|
||||||
>Identification Document</option>
|
>Identification Document</option>
|
||||||
<option
|
<option
|
||||||
value="N"
|
value="N"
|
||||||
>Spanish residence permit</option>
|
>Spanish residence permit</option>
|
||||||
<option
|
<option
|
||||||
value="X"
|
value="X"
|
||||||
>European residence permit</option>
|
>European residence permit</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div t-attf-class="form-group col-xl-6">
|
<div
|
||||||
<label
|
t-attf-class="form-group col-xl-6"
|
||||||
|
>
|
||||||
|
<label
|
||||||
class="col-form-label"
|
class="col-form-label"
|
||||||
for="document_number"
|
for="document_number"
|
||||||
>Doc. number</label>
|
>Doc. number</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
name="document_number"
|
t-att-name="'document_number-'+ str(count)"
|
||||||
t-attf-class="form-control"
|
t-attf-class="form-control"
|
||||||
t-att-value="doc_number or checkin_partner.document_number"
|
t-att-value="doc_number or checkin_partner.document_number"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div t-attf-class="form-group col-xl-6">
|
<div
|
||||||
<label
|
t-attf-class="form-group col-xl-6"
|
||||||
|
>
|
||||||
|
<label
|
||||||
class="col-form-label"
|
class="col-form-label"
|
||||||
for="document_expedition_date"
|
for="document_expedition_date"
|
||||||
>Doc. expedition date</label>
|
>Doc. expedition date</label>
|
||||||
<input
|
<input
|
||||||
type="date"
|
type="date"
|
||||||
name="document_expedition_date"
|
t-att-name="'document_expedition_date-'+ str(count)"
|
||||||
t-attf-class="form-control"
|
t-attf-class="form-control"
|
||||||
t-att-value="doc_exp_date or checkin_partner.document_expedition_date"
|
t-att-value="doc_exp_date or checkin_partner.document_expedition_date"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div t-attf-class="form-group col-xl-6">
|
<div
|
||||||
<label
|
t-attf-class="form-group col-xl-6"
|
||||||
|
>
|
||||||
|
<label
|
||||||
class="col-form-label"
|
class="col-form-label"
|
||||||
for="mobile"
|
for="mobile"
|
||||||
>Mobile</label>
|
>Mobile</label>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
name="mobile"
|
t-att-name="'mobile-'+ str(count)"
|
||||||
t-attf-class="form-control"
|
t-attf-class="form-control"
|
||||||
t-att-value="mobile or checkin_partner.mobile"
|
t-att-value="mobile or checkin_partner.mobile"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div t-attf-class="form-group col-xl-6">
|
<div
|
||||||
<label
|
t-attf-class="form-group col-xl-6"
|
||||||
|
>
|
||||||
|
<label
|
||||||
class="col-form-label"
|
class="col-form-label"
|
||||||
for="email"
|
for="email"
|
||||||
>Email</label>
|
>Email</label>
|
||||||
<input
|
<input
|
||||||
type="email"
|
type="email"
|
||||||
name="email"
|
t-att-name="'email-'+ str(count)"
|
||||||
t-attf-class="form-control"
|
t-attf-class="form-control"
|
||||||
t-att-value="email or checkin_partner.email"
|
t-att-value="email or checkin_partner.email"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
t-attf-class="form-group col-xl-6 d-none"
|
t-attf-class="form-group col-xl-6 d-none"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
name="id"
|
t-att-name="'id-'+ str(count)"
|
||||||
t-attf-class="form-control"
|
t-attf-class="form-control"
|
||||||
t-att-value="id or checkin_partner.id"
|
t-att-value="id or checkin_partner.id"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</td>
|
||||||
</td>
|
</tr>
|
||||||
</tr>
|
</t>
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<div class="clearfix">
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
class="btn btn-primary float-right mb32 "
|
|
||||||
>
|
|
||||||
Confirm
|
|
||||||
<span class="fa fa-long-arrow-right" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</form>
|
|
||||||
</t>
|
</t>
|
||||||
</t>
|
<div t-attf-class="form-group col-xl-6 d-none">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
t-att-name="'folio_id'"
|
||||||
|
t-attf-class="form-control"
|
||||||
|
t-att-value="folio_id or folio.id"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div class="clearfix">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
class="btn btn-primary float-right mb32 "
|
||||||
|
>
|
||||||
|
Confirm
|
||||||
|
<span class="fa fa-long-arrow-right" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</form>
|
||||||
</tbody>
|
</tbody>
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
|
|||||||
Reference in New Issue
Block a user