Skip to content

Commit

Permalink
[MIG] account_statement_import_online_ponto: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianTessera committed Nov 15, 2024
1 parent 71b98fc commit 0c4586c
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 9 deletions.
4 changes: 4 additions & 0 deletions account_statement_import_online_ponto/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ Contributors

- Ronald Portier <ronald@therp.nl>

- `Tesseratech <https://tesseratech.es>`__:

- Christian Doñate

Maintainers
-----------

Expand Down
2 changes: 1 addition & 1 deletion account_statement_import_online_ponto/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Online Bank Statements: MyPonto.com",
"version": "16.0.1.1.1",
"version": "17.0.1.1.1",
"category": "Account",
"website": "https://github.com/OCA/bank-statement-import",
"author": "Florent de Labarre, Therp BV, Odoo Community Association (OCA)",
Expand Down
2 changes: 2 additions & 0 deletions account_statement_import_online_ponto/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
- João Marques
- [Therp BV](https://therp.nl):
- Ronald Portier \<<ronald@therp.nl>\>
- [Tesseratech](https://tesseratech.es):
- Christian Doñate
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,10 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>Ronald Portier &lt;<a class="reference external" href="mailto:ronald&#64;therp.nl">ronald&#64;therp.nl</a>&gt;</li>
</ul>
</li>
<li><a class="reference external" href="https://tesseratech.es">Tesseratech</a>:<ul>
<li>Christian Doñate</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,11 @@ def test_balance_start(self):
self.provider._create_or_update_statement(
data, statement_date, datetime(2019, 11, 2)
)
with self.mock_login(), self.mock_set_access_account(), self.mock_get_transactions(): # noqa: B950
with (
self.mock_login(),
self.mock_set_access_account(),
self.mock_get_transactions(),
): # noqa: B950
vals = {
"date_since": datetime(2019, 11, 4),
"date_until": datetime(2019, 11, 5),
Expand All @@ -277,23 +281,35 @@ def test_balance_start(self):
self.assertEqual(new_statement.balance_end, 105.83)

def test_ponto_execution_date(self):
with self.mock_login(), self.mock_set_access_account(), self.mock_get_transactions(): # noqa: B950
with (
self.mock_login(),
self.mock_set_access_account(),
self.mock_get_transactions(),
): # noqa: B950
# First base selection on execution date.
self.provider.ponto_date_field = "execution_date"
statement = self._get_statements_from_wizard() # Will get 1 statement
self._check_line_count(statement.line_ids, expected_count=2)
self._check_statement_amounts(statement, transaction_amounts[:2])

def test_ponto_value_date(self):
with self.mock_login(), self.mock_set_access_account(), self.mock_get_transactions(): # noqa: B950
with (
self.mock_login(),
self.mock_set_access_account(),
self.mock_get_transactions(),
): # noqa: B950
# First base selection on execution date.
self.provider.ponto_date_field = "value_date"
statement = self._get_statements_from_wizard() # Will get 1 statement
self._check_line_count(statement.line_ids, expected_count=3)
self._check_statement_amounts(statement, transaction_amounts[:3])

def test_ponto_get_transactions_multi(self):
with self.mock_login(), self.mock_set_access_account(), self.mock_get_transactions_multi(): # noqa: B950
with (
self.mock_login(),
self.mock_set_access_account(),
self.mock_get_transactions_multi(),
): # noqa: B950
# First base selection on execution date.
self.provider.ponto_date_field = "execution_date"
# Expect statements for october and november.
Expand All @@ -310,7 +326,11 @@ def test_ponto_get_transactions_multi(self):
)

def test_ponto_scheduled(self):
with self.mock_login(), self.mock_set_access_account(), self.mock_get_transactions(): # noqa: B950
with (
self.mock_login(),
self.mock_set_access_account(),
self.mock_get_transactions(),
): # noqa: B950
# Scheduled should get all transaction, ignoring date_until.
self.provider.ponto_last_identifier = False
date_since = datetime(2019, 11, 3)
Expand All @@ -326,7 +346,11 @@ def test_ponto_scheduled(self):
)

def test_ponto_scheduled_from_identifier(self):
with self.mock_login(), self.mock_set_access_account(), self.mock_get_transactions(): # noqa: B950
with (
self.mock_login(),
self.mock_set_access_account(),
self.mock_get_transactions(),
): # noqa: B950
# Scheduled should get all transactions after last identifier.
self.provider.ponto_last_identifier = "9ac50483-16dc-4a82-aa60-df56077405cd"
date_since = datetime(2019, 11, 3)
Expand Down Expand Up @@ -416,7 +440,11 @@ def test_wizard_action_debug(self):
self.provider._create_or_update_statement(
data, statement_date, datetime(2019, 11, 2)
)
with self.mock_login(), self.mock_set_access_account(), self.mock_get_transactions(): # noqa: B950
with (
self.mock_login(),
self.mock_set_access_account(),
self.mock_get_transactions(),
): # noqa: B950
vals = {
"date_since": datetime(2019, 11, 4),
"date_until": datetime(2019, 11, 5),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<group
name="ponto"
string="Ponto Config"
attrs="{'invisible':[('service','!=','ponto')]}"
invisible="service != 'ponto'"
>
<field name="username" string="Login" />
<field name="password" string="Secret Key" />
Expand Down

0 comments on commit 0c4586c

Please sign in to comment.