mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX] pms: 2nd last name not mandatory & fix doc != dni
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -133,7 +133,6 @@ class PmsCheckinPartner(models.Model):
|
||||
)
|
||||
mandatory_fields.extend(
|
||||
[
|
||||
"lastname2",
|
||||
"birthdate_date",
|
||||
"document_number",
|
||||
"document_type",
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user