[FIX] pms: 2nd last name not mandatory & fix doc != dni

This commit is contained in:
miguelpadin
2021-05-18 16:42:55 +02:00
parent ea0b66b150
commit f5c2320f25
3 changed files with 11 additions and 8 deletions

View File

@@ -15,7 +15,7 @@
name="nextcall"
eval="datetime.now(pytz.timezone('UTC')).strftime('%Y-%m-%d 03:00:00')"
/>
<field name="code">model.generate_file()</field>
<field name="code">model.send_file_gc()</field>
</record>
</data>
</odoo>

View File

@@ -133,7 +133,6 @@ class PmsCheckinPartner(models.Model):
)
mandatory_fields.extend(
[
"lastname2",
"birthdate_date",
"document_number",
"document_type",

View File

@@ -121,8 +121,8 @@ class TravellerReport(models.TransientModel):
content += line.document_expedition_date.strftime("%Y%m%d") + "|"
content += line.lastname.upper() + "|"
if line.lastname2:
content += line.lastname2.upper() + "|"
content += line.firstname.upper() + "|"
content += line.lastname2.upper()
content += "|" + line.firstname.upper() + "|"
if line.gender == "female":
content += "F|"
else:
@@ -148,7 +148,8 @@ class TravellerReport(models.TransientModel):
session = requests.Session()
# send info to GC
response = session.post(
# response = \
session.post(
url="https://"
+ pms_property.institution_user
+ ":"
@@ -162,8 +163,11 @@ class TravellerReport(models.TransientModel):
"application/octet-stream",
)
},
# TODO: review verify=False if cert.pen is not present
verify=get_module_resource("pms_l10n_es", "static", "cert.pem"),
)
# if the response is not ok raise validation error
if response.content != b"CORRECTO\r\n":
raise ValidationError(response.content.decode())
# TODO: review if the response is not ok raise validation error
# print(response.content)
# if response.content != b'CORRECTO\r\n':
# raise ValidationError(response.content.decode())