[IMP]pms: signature and signature on fields in checkin partner

This commit is contained in:
braisab
2024-05-24 17:29:23 +02:00
committed by Darío Lodeiros
parent 93afd43d99
commit 1cbc92fcc7
3 changed files with 48 additions and 5 deletions

View File

@@ -286,6 +286,17 @@ class PmsCheckinPartner(models.Model):
string="Partner relationship", help="Family relationship between travelers"
)
signature = fields.Image(
string="Signature",
help="Signature of the guest",
)
sign_on = fields.Datetime(
string="Sign on",
help="Date and time of the signature",
compute="_compute_sign_on",
)
@api.depends("partner_id")
def _compute_document_number(self):
for record in self:
@@ -605,6 +616,14 @@ class PmsCheckinPartner(models.Model):
else:
record.partner_incongruences = False
@api.depends("signature")
def _compute_sign_on(self):
for record in self:
if record.signature:
record.sign_on = datetime.now()
else:
record.sign_on = False
def _compute_access_url(self):
super(PmsCheckinPartner, self)._compute_access_url()
for checkin in self:

View File

@@ -116,6 +116,8 @@
<field name="folio_id" />
<field name="identifier" />
<field name="partner_relationship" />
<field name="signature" />
<field name="sign_on" />
<field name="pms_property_id" invisible="1" />
</group>
</group>

View File

@@ -149,9 +149,17 @@
t-options="{&quot;widget&quot;: &quot;date&quot;}"
/>
</p>
<div class="firma" />
<div class="sign">
<div class="signature-wrapper" t-if="docs.signature">
<img
class="checkin-signature"
t-attf-src="data:image/*;base64,{{docs.signature}}"
/>
</div>
</div>
<br />
<p class="signature">Traveler's signature</p>
<p>
<span t-field="docs.pms_property_id.cardex_warning" />
</p>
@@ -337,11 +345,25 @@
border:double;
border-width:1px;
}
.firma{
width: 85%;
.sign{
width: 100%;
border:dotted 1px;
height: 80px;
margin:0 auto;
height: 100px;
display: flex;
justify-content: center;
align-items: center;
}
.signature-wrapper {
width: 200px;
height: 100px;
display: flex;
justify-content: center;
align-items: center;
margin: 0 auto;
}
.checkin-signature {
width: 100%;
height: 100%;
}
p,.property{
text-align: center;