[MIG] account_statement_import_camt54: Migration to 15.0

This commit is contained in:
Maksym Yankin
2022-01-26 15:34:13 +02:00
parent 13b6150578
commit 85d759991a
9 changed files with 24 additions and 20 deletions

View File

@@ -14,13 +14,13 @@ Bank Account Camt54 Import
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3 :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fbank--statement--import-lightgray.png?logo=github .. |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_camt54 :target: https://github.com/OCA/bank-statement-import/tree/15.0/account_statement_import_camt54
:alt: OCA/bank-statement-import :alt: OCA/bank-statement-import
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png .. |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_camt54 :target: https://translation.odoo-community.org/projects/bank-statement-import-15-0/bank-statement-import-15-0-account_statement_import_camt54
:alt: Translate me on Weblate :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png .. |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 :alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5| |badge1| |badge2| |badge3| |badge4| |badge5|
@@ -59,7 +59,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/bank-statement-import/issues>`_. 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. 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 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_camt54%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_camt54%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. Do not contact contributors directly about support or help with technical issues.
@@ -95,6 +95,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use. promote its widespread use.
This module is part of the `OCA/bank-statement-import <https://github.com/OCA/bank-statement-import/tree/14.0/account_statement_import_camt54>`_ 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_camt54>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{ {
"name": "Bank Account Camt54 Import", "name": "Bank Account Camt54 Import",
"version": "14.0.1.1.0", "version": "15.0.1.0.0",
"category": "Account", "category": "Account",
"website": "https://github.com/OCA/bank-statement-import", "website": "https://github.com/OCA/bank-statement-import",
"author": "camptocamp, " "Odoo Community Association (OCA)", "author": "camptocamp, " "Odoo Community Association (OCA)",

View File

@@ -4,7 +4,7 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 14.0\n" "Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"

View File

@@ -4,7 +4,7 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 14.0\n" "Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-11-25 17:36+0000\n" "PO-Revision-Date: 2021-11-25 17:36+0000\n"
"Last-Translator: Sergio Zanchetta <primes2h@gmail.com>\n" "Last-Translator: Sergio Zanchetta <primes2h@gmail.com>\n"

View File

@@ -34,6 +34,7 @@ class AccountStatementImport(models.TransientModel):
statement.balance_end_real = statement.balance_start statement.balance_end_real = statement.balance_start
else: else:
statement.balance_end_real = statement.balance_start + amount statement.balance_end_real = statement.balance_start + amount
return
def _complete_stmts_vals(self, stmts_vals, journal, account_number): def _complete_stmts_vals(self, stmts_vals, journal, account_number):
"""Search partner from partner reference""" """Search partner from partner reference"""

View File

@@ -35,7 +35,7 @@ class CamtParser(models.AbstractModel):
start = int(start) - 1 # count from 1 instead of 0 start = int(start) - 1 # count from 1 instead of 0
size = int(size) size = int(size)
end = start + size end = start + size
except ValueError: except ValueError as err:
raise exceptions.UserError( raise exceptions.UserError(
_( _(
"Config parameter `isr_partner_ref` is wrong.\n" "Config parameter `isr_partner_ref` is wrong.\n"
@@ -43,7 +43,7 @@ class CamtParser(models.AbstractModel):
"`i` and `n` must be integers.\n" "`i` and `n` must be integers.\n"
'e.g. "13,6"' 'e.g. "13,6"'
) )
) ) from err
return isr[start:end].lstrip("0") return isr[start:end].lstrip("0")
def parse_transaction_details(self, ns, node, transaction): def parse_transaction_details(self, ns, node, transaction):

View File

@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! 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_camt54"><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_camt54"><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_camt54"><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_camt54"><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>
<blockquote> <blockquote>
This module allows you to import CAMT.054 file (details of customers payments batch) into a dedicated journal taking care of the start/end balance and the remittance reference number.</blockquote> This module allows you to import CAMT.054 file (details of customers payments batch) into a dedicated journal taking care of the start/end balance and the remittance reference number.</blockquote>
<p>Customer invoices will be reconciled/Paid. Payment entries will be posted into an internal transfer account (that you have to create with a type current asset and set on the journal)</p> <p>Customer invoices will be reconciled/Paid. Payment entries will be posted into an internal transfer account (that you have to create with a type current asset and set on the journal)</p>
@@ -402,7 +402,7 @@ For instance <cite>13,6</cite> to start on position 13 with a 6 digit long refer
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/bank-statement-import/issues">GitHub Issues</a>. <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. 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 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_camt54%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_camt54%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> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
@@ -433,7 +433,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> promote its widespread use.</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_camt54">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_camt54">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> <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>
</div> </div>

View File

@@ -5,10 +5,11 @@ from odoo.tests import common
class TestGetPartnerRef(common.TransactionCase): class TestGetPartnerRef(common.TransactionCase):
def setUp(self): @classmethod
super().setUp() def setUpClass(cls):
self.Parser = self.env["account.statement.import.camt.parser"] super().setUpClass()
self.ICP = self.env["ir.config_parameter"] cls.Parser = cls.env["account.statement.import.camt.parser"]
cls.ICP = cls.env["ir.config_parameter"]
def test_no_ICP(self): def test_no_ICP(self):
"""Test no partner ref is read if param is not set""" """Test no partner ref is read if param is not set"""

View File

@@ -4,13 +4,15 @@
import base64 import base64
from odoo.modules.module import get_module_resource from odoo.modules.module import get_module_resource
from odoo.tests.common import SavepointCase from odoo.tests.common import TransactionCase
class TestGenerateBankStatement(SavepointCase): class TestGenerateBankStatement(TransactionCase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
super().setUpClass() super().setUpClass()
eur = cls.env.ref("base.EUR")
eur.write({"active": True})
bank = cls.env["res.partner.bank"].create( bank = cls.env["res.partner.bank"].create(
{ {
"acc_number": "NL77ABNA0574908765", "acc_number": "NL77ABNA0574908765",
@@ -33,7 +35,7 @@ class TestGenerateBankStatement(SavepointCase):
"code": "TBNKCAMT", "code": "TBNKCAMT",
"type": "bank", "type": "bank",
"bank_account_id": bank.id, "bank_account_id": bank.id,
"currency_id": cls.env.ref("base.EUR").id, "currency_id": eur.id,
} }
) )