|
@ -199,6 +199,7 @@ class OnlineBankStatementProviderPonto(models.Model): |
|
|
return dt.replace(tzinfo=None) |
|
|
return dt.replace(tzinfo=None) |
|
|
|
|
|
|
|
|
def _ponto_obtain_statement_data(self, date_since, date_until): |
|
|
def _ponto_obtain_statement_data(self, date_since, date_until): |
|
|
|
|
|
"""Translate information from Ponto to Odoo bank statement lines.""" |
|
|
self.ensure_one() |
|
|
self.ensure_one() |
|
|
account_ids = self._ponto_get_account_ids() |
|
|
account_ids = self._ponto_get_account_ids() |
|
|
journal = self.journal_id |
|
|
journal = self.journal_id |
|
@ -217,6 +218,14 @@ class OnlineBankStatementProviderPonto(models.Model): |
|
|
sequence = 0 |
|
|
sequence = 0 |
|
|
for transaction in transaction_lines: |
|
|
for transaction in transaction_lines: |
|
|
sequence += 1 |
|
|
sequence += 1 |
|
|
|
|
|
vals_line = self._ponto_get_transaction_vals(transaction, sequence) |
|
|
|
|
|
new_transactions.append(vals_line) |
|
|
|
|
|
if new_transactions: |
|
|
|
|
|
return new_transactions, {} |
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
def _ponto_get_transaction_vals(self, transaction, sequence): |
|
|
|
|
|
"""Translate information from Ponto to statement line vals.""" |
|
|
attributes = transaction.get("attributes", {}) |
|
|
attributes = transaction.get("attributes", {}) |
|
|
ref_list = [ |
|
|
ref_list = [ |
|
|
attributes.get(x) |
|
|
attributes.get(x) |
|
@ -241,7 +250,4 @@ class OnlineBankStatementProviderPonto(models.Model): |
|
|
vals_line["account_number"] = attributes["counterpartReference"] |
|
|
vals_line["account_number"] = attributes["counterpartReference"] |
|
|
if attributes.get("counterpartName"): |
|
|
if attributes.get("counterpartName"): |
|
|
vals_line["partner_name"] = attributes["counterpartName"] |
|
|
vals_line["partner_name"] = attributes["counterpartName"] |
|
|
new_transactions.append(vals_line) |
|
|
|
|
|
if new_transactions: |
|
|
|
|
|
return new_transactions, {} |
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
return vals_line |