From d4e0bf734fe4b3982a70ebebe31acb6ba01ae96e Mon Sep 17 00:00:00 2001 From: mgite Date: Sat, 2 Nov 2024 01:41:39 +0400 Subject: [PATCH] Remove submodule --- TBC_integration_lib | 1 - bross.py | 4 +++- bross_bank_management/models/bank_settings.py | 8 +++----- 3 files changed, 6 insertions(+), 7 deletions(-) delete mode 160000 TBC_integration_lib diff --git a/TBC_integration_lib b/TBC_integration_lib deleted file mode 160000 index 026e861..0000000 --- a/TBC_integration_lib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 026e86100527c2105c8c396d1b30bbdefd612fe6 diff --git a/bross.py b/bross.py index bfe5901..806c19c 100755 --- a/bross.py +++ b/bross.py @@ -18,7 +18,7 @@ headers = { # response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/analytics/services/cancelled?startDate=20241008&endDate=20241008&dateKind=0", headers=headers) # PAYMENTS TIME PERIOD -response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/analytics/payments?startDateTime=202408010000&endDateTime=202408072359&includeServices=true", headers=headers) +# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/analytics/payments?startDateTime=202408010000&endDateTime=202408072359&includeServices=true", headers=headers) # BOOKINGS TIME PERIOD # response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/bookings?modifiedFrom=2024-01-01T00:00&modifiedTo=2024-01-30T23:59&state=Active", headers=headers) @@ -26,6 +26,8 @@ response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/analytics/ # BOOKING # response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/bookings/20241009-503875-1220777184", headers=headers) # Room move +# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/bookings/20241106-503875-1217522037", headers=headers) # Cancelled booking +# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/bookings/20240727-503875-1216958604", headers=headers) # INVOICES # response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/bookings/20241009-503875-1220777184/invoices?language=en", headers=headers) diff --git a/bross_bank_management/models/bank_settings.py b/bross_bank_management/models/bank_settings.py index 9bf9a4f..d7dcede 100644 --- a/bross_bank_management/models/bank_settings.py +++ b/bross_bank_management/models/bank_settings.py @@ -1,4 +1,5 @@ import base64 +from io import BytesIO import tempfile import os from odoo import models, fields, _ @@ -21,14 +22,11 @@ class BankSettings(models.Model): def get_request_object(self): config = self.env.ref('bross_bank_management.bank_api_configuration') cert_data = base64.b64decode(config.cert_file_path) - - with tempfile.NamedTemporaryFile(delete=False, suffix='.pfx') as temp_cert_file: - temp_cert_file.write(cert_data) - temp_cert_file_path = temp_cert_file.name + cert_file_stream = BytesIO(cert_data) client = TBCBankClient( config.wsdl_url, - temp_cert_file_path, + cert_file_stream, config.cert_password, config.username, config.current_password