[MIG] account_bank_statement_import_online_paypal: Migration to 15.0

This commit is contained in:
ikapasi
2022-05-25 09:54:00 +05:30
committed by Stefan
parent 815fb99f20
commit f4e1a399fe
7 changed files with 48 additions and 35 deletions

View File

@@ -14,13 +14,13 @@ Online Bank Statements: PayPal.com
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fbank--statement--import-lightgray.png?logo=github
:target: https://github.com/OCA/bank-statement-import/tree/14.0/account_statement_import_online_paypal
:target: https://github.com/OCA/bank-statement-import/tree/15.0/account_statement_import_online_paypal
:alt: OCA/bank-statement-import
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/bank-statement-import-14-0/bank-statement-import-14-0-account_statement_import_online_paypal
:target: https://translation.odoo-community.org/projects/bank-statement-import-15-0/bank-statement-import-15-0-account_statement_import_online_paypal
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/174/14.0
:target: https://runbot.odoo-community.org/runbot/174/15.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -97,7 +97,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/bank-statement-import/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/bank-statement-import/issues/new?body=module:%20account_statement_import_online_paypal%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/bank-statement-import/issues/new?body=module:%20account_statement_import_online_paypal%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
@@ -116,6 +116,7 @@ Contributors
* Alexey Pelykh <alexey.pelykh@corphub.eu>
* Omar Castiñeira <omar@comunitea.com>
* isufi kapasi <isufi.kapasi@initos.com>
Maintainers
~~~~~~~~~~~
@@ -138,6 +139,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-alexey-pelykh|
This module is part of the `OCA/bank-statement-import <https://github.com/OCA/bank-statement-import/tree/14.0/account_statement_import_online_paypal>`_ project on GitHub.
This module is part of the `OCA/bank-statement-import <https://github.com/OCA/bank-statement-import/tree/15.0/account_statement_import_online_paypal>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -4,7 +4,7 @@
{
"name": "Online Bank Statements: PayPal.com",
"version": "14.0.1.0.0",
"version": "15.0.1.0.0",
"author": "CorporateHub, Odoo Community Association (OCA)",
"maintainers": ["alexey-pelykh"],
"website": "https://github.com/OCA/bank-statement-import",

View File

@@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -215,11 +215,6 @@ msgstr ""
msgid "Direct payment API"
msgstr ""
#. module: account_statement_import_online_paypal
#: model:ir.model.fields,field_description:account_statement_import_online_paypal.field_online_bank_statement_provider__display_name
msgid "Display Name"
msgstr ""
#. module: account_statement_import_online_paypal
#: code:addons/account_statement_import_online_paypal/models/online_bank_statement_provider_paypal.py:0
#, python-format
@@ -246,9 +241,18 @@ msgstr ""
#. module: account_statement_import_online_paypal
#: code:addons/account_statement_import_online_paypal/models/online_bank_statement_provider_paypal.py:0
#, python-format
msgid ""
"Failed to resolve transaction %(first_transaction_id)s "
"(%(first_transaction_date)s)"
msgstr ""
#. module: account_statement_import_online_paypal
#: code:addons/account_statement_import_online_paypal/models/online_bank_statement_provider_paypal.py:0
#, python-format
msgid "Failed to resolve transaction %s (%s)"
msgid ""
"Failed to resolve transaction %(last_transaction_id)s "
"(%(last_transaction_date)s)"
msgstr ""
#. module: account_statement_import_online_paypal
@@ -486,11 +490,6 @@ msgstr ""
msgid "Hold for dispute investigation"
msgstr ""
#. module: account_statement_import_online_paypal
#: model:ir.model.fields,field_description:account_statement_import_online_paypal.field_online_bank_statement_provider__id
msgid "ID"
msgstr ""
#. module: account_statement_import_online_paypal
#: code:addons/account_statement_import_online_paypal/models/online_bank_statement_provider_paypal.py:0
#, python-format
@@ -521,11 +520,6 @@ msgstr ""
msgid "Invoice %s"
msgstr ""
#. module: account_statement_import_online_paypal
#: model:ir.model.fields,field_description:account_statement_import_online_paypal.field_online_bank_statement_provider____last_update
msgid "Last Modified on"
msgstr ""
#. module: account_statement_import_online_paypal
#: code:addons/account_statement_import_online_paypal/models/online_bank_statement_provider_paypal.py:0
#, python-format

View File

@@ -230,8 +230,12 @@ class OnlineBankStatementProviderPayPal(models.Model):
)
if not first_transaction:
raise UserError(
_("Failed to resolve transaction %s (%s)")
% (first_transaction_id, first_transaction_date)
_(
"Failed to resolve transaction %(first_transaction_id)s "
"(%(first_transaction_date)s)",
first_transaction_id=first_transaction_id,
first_transaction_date=first_transaction_date,
)
)
balance_start = self._paypal_get_transaction_ending_balance(first_transaction)
balance_start -= self._paypal_get_transaction_total_amount(first_transaction)
@@ -245,8 +249,12 @@ class OnlineBankStatementProviderPayPal(models.Model):
)
if not last_transaction:
raise UserError(
_("Failed to resolve transaction %s (%s)")
% (last_transaction_id, last_transaction_date)
_(
"Failed to resolve transaction %(last_transaction_id)s "
"(%(last_transaction_date)s)",
last_transaction_id=last_transaction_id,
last_transaction_date=last_transaction_date,
)
)
balance_end = self._paypal_get_transaction_ending_balance(last_transaction)
@@ -496,7 +504,7 @@ class OnlineBankStatementProviderPayPal(models.Model):
"total_pages": 0,
}
raise self._paypal_decode_error(content) or e
raise self._paypal_decode_error(content) or e from None
return json.loads(content)
@api.model

View File

@@ -2,3 +2,4 @@
* Alexey Pelykh <alexey.pelykh@corphub.eu>
* Omar Castiñeira <omar@comunitea.com>
* isufi kapasi <isufi.kapasi@initos.com>

View File

@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/bank-statement-import/tree/14.0/account_statement_import_online_paypal"><img alt="OCA/bank-statement-import" src="https://img.shields.io/badge/github-OCA%2Fbank--statement--import-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/bank-statement-import-14-0/bank-statement-import-14-0-account_statement_import_online_paypal"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/174/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/bank-statement-import/tree/15.0/account_statement_import_online_paypal"><img alt="OCA/bank-statement-import" src="https://img.shields.io/badge/github-OCA%2Fbank--statement--import-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/bank-statement-import-15-0/bank-statement-import-15-0-account_statement_import_online_paypal"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/174/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module provides online bank statements from
<a class="reference external" href="https://paypal.com/">PayPal.com</a>.</p>
<p><strong>Table of contents</strong></p>
@@ -449,7 +449,7 @@ behaviour in case #06650320 (private).</li>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/bank-statement-import/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/bank-statement-import/issues/new?body=module:%20account_statement_import_online_paypal%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/bank-statement-import/issues/new?body=module:%20account_statement_import_online_paypal%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@@ -468,6 +468,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
</ul>
</li>
<li>Omar Castiñeira &lt;<a class="reference external" href="mailto:omar&#64;comunitea.com">omar&#64;comunitea.com</a>&gt;</li>
<li>isufi kapasi &lt;<a class="reference external" href="mailto:isufi.kapasi&#64;initos.com">isufi.kapasi&#64;initos.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
@@ -479,7 +480,7 @@ mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external" href="https://github.com/alexey-pelykh"><img alt="alexey-pelykh" src="https://github.com/alexey-pelykh.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/bank-statement-import/tree/14.0/account_statement_import_online_paypal">OCA/bank-statement-import</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/bank-statement-import/tree/15.0/account_statement_import_online_paypal">OCA/bank-statement-import</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>

View File

@@ -144,7 +144,9 @@ class TestAccountBankAccountStatementImportOnlinePayPal(common.TransactionCase):
_provider_class + "._paypal_retrieve",
return_value=mocked_response,
):
with self.assertRaises(Exception):
with self.assertRaisesRegex(
UserError, "PayPal App features are configured incorrectly!"
):
provider._paypal_get_token()
def test_bad_token_type(self):
@@ -175,7 +177,7 @@ class TestAccountBankAccountStatementImportOnlinePayPal(common.TransactionCase):
_provider_class + "._paypal_retrieve",
return_value=mocked_response,
):
with self.assertRaises(Exception):
with self.assertRaisesRegex(UserError, "Invalid token type!"):
provider._paypal_get_token()
def test_no_token(self):
@@ -205,7 +207,9 @@ class TestAccountBankAccountStatementImportOnlinePayPal(common.TransactionCase):
_provider_class + "._paypal_retrieve",
return_value=mocked_response,
):
with self.assertRaises(Exception):
with self.assertRaisesRegex(
UserError, "Failed to acquire token using Client ID and Secret!"
):
provider._paypal_get_token()
def test_no_data_on_monday(self):
@@ -434,7 +438,11 @@ class TestAccountBankAccountStatementImportOnlinePayPal(common.TransactionCase):
_provider_class + "._paypal_retrieve",
return_value=mocked_response,
), self.mock_token():
with self.assertRaises(Exception):
with self.assertRaisesRegex(
UserError,
"PayPal allows retrieving transactions only up to 3 years in "
"the past. Please import older transactions manually.",
):
provider._obtain_statement_data(
self.now - relativedelta(years=5),
self.now,