Skip to content

Commit

Permalink
[IMP]account_statement_import_online_plaid: The maximum number of rec…
Browse files Browse the repository at this point in the history
…ords per request has been increased.
  • Loading branch information
adasatorres committed Feb 10, 2025
1 parent 40e7944 commit c92e132
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,21 @@ def _login(self, client, public_token):
return response["access_token"]

def _get_transactions(self, client, access_token, start_date, end_date):
options = TransactionsGetRequestOptions(
count=500,
)
request = TransactionsGetRequest(
access_token=access_token,
start_date=start_date.date(),
end_date=end_date.date(),
options=options,
)
try:
response = client.transactions_get(request)
except plaid.ApiException as e:
raise ValidationError(_("Error getting transactions: %s") % e.body) from e
transactions = response["transactions"]
while len(transactions) < response["total_transactions"]:
options = TransactionsGetRequestOptions()
options.offset = len(transactions)
request = TransactionsGetRequest(

Check warning on line 83 in account_statement_import_online_plaid/models/plaid_interface.py

View check run for this annotation

Codecov / codecov/patch

account_statement_import_online_plaid/models/plaid_interface.py#L82-L83

Added lines #L82 - L83 were not covered by tests
access_token=access_token,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
<field
name="username"
attrs="{'required': [('service', '=', 'plaid')]}"
widget="password"
password="1"
string="Client ID"
/>
<field
name="password"
attrs="{'required': [('service', '=', 'plaid')]}"
widget="password"
password="1"
string="Secret Key"
/>
<field
Expand All @@ -45,4 +45,4 @@
</xpath>
</field>
</record>
</odoo>
</odoo>

0 comments on commit c92e132

Please sign in to comment.