fix: attribute error on Bank Statement Import retry

(cherry picked from commit aec630c74f)
This commit is contained in:
ruthra kumar
2024-03-17 06:46:06 +05:30
committed by Mergify
parent 5729ee563c
commit a0bf22c9a5

View File

@@ -148,6 +148,9 @@ def start_import(
import_file = ImportFile("Bank Transaction", file=file, import_type="Insert New Records")
data = parse_data_from_template(import_file.raw_data)
# Importer expects 'Data Import' class, which has 'payload_count' attribute
if not data_import.get("payload_count"):
data_import.payload_count = len(data) - 1
if import_file_path:
add_bank_account(data, bank_account)