[MIG] account_statement_import_camt54: Migration to 15.0

This commit is contained in:
Maksym Yankin
2022-01-26 15:34:13 +02:00
committed by sonhd91
parent 15f1f015d6
commit 61c898b569
9 changed files with 24 additions and 41 deletions

View File

@@ -14,13 +14,13 @@ Bank Account Camt54 Import
: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_camt54
:target: https://github.com/OCA/bank-statement-import/tree/15.0/account_statement_import_camt54
: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_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
.. |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|
@@ -59,7 +59,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_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.
@@ -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
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.

View File

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

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"
@@ -44,25 +44,11 @@ msgid ""
"e.g. \"13,6\""
msgstr ""
#. module: account_statement_import_camt54
#: model:ir.model.fields,field_description:account_statement_import_camt54.field_account_journal__display_name
#: model:ir.model.fields,field_description:account_statement_import_camt54.field_account_statement_import__display_name
#: model:ir.model.fields,field_description:account_statement_import_camt54.field_account_statement_import_camt_parser__display_name
msgid "Display Name"
msgstr ""
#. module: account_statement_import_camt54
#: model:ir.model.fields,help:account_statement_import_camt54.field_account_journal__transfer_line
msgid "Generate balance line on total of bank statement import"
msgstr ""
#. module: account_statement_import_camt54
#: model:ir.model.fields,field_description:account_statement_import_camt54.field_account_journal__id
#: model:ir.model.fields,field_description:account_statement_import_camt54.field_account_statement_import__id
#: model:ir.model.fields,field_description:account_statement_import_camt54.field_account_statement_import_camt_parser__id
msgid "ID"
msgstr ""
#. module: account_statement_import_camt54
#: model:ir.model,name:account_statement_import_camt54.model_account_statement_import
msgid "Import Bank Statement Files"
@@ -72,10 +58,3 @@ msgstr ""
#: model:ir.model,name:account_statement_import_camt54.model_account_journal
msgid "Journal"
msgstr ""
#. module: account_statement_import_camt54
#: model:ir.model.fields,field_description:account_statement_import_camt54.field_account_journal____last_update
#: model:ir.model.fields,field_description:account_statement_import_camt54.field_account_statement_import____last_update
#: model:ir.model.fields,field_description:account_statement_import_camt54.field_account_statement_import_camt_parser____last_update
msgid "Last Modified on"
msgstr ""

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"
"PO-Revision-Date: 2021-11-25 17:36+0000\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
else:
statement.balance_end_real = statement.balance_start + amount
return
def _complete_stmts_vals(self, stmts_vals, journal, account_number):
"""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
size = int(size)
end = start + size
except ValueError:
except ValueError as err:
raise exceptions.UserError(
_(
"Config parameter `isr_partner_ref` is wrong.\n"
@@ -43,7 +43,7 @@ class CamtParser(models.AbstractModel):
"`i` and `n` must be integers.\n"
'e.g. "13,6"'
)
)
) from err
return isr[start:end].lstrip("0")
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 !!
!! 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>
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>
@@ -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>.
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_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>
</div>
<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
mission is to support the collaborative development of Odoo features and
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>
</div>
</div>

View File

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

View File

@@ -4,13 +4,15 @@
import base64
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
def setUpClass(cls):
super().setUpClass()
eur = cls.env.ref("base.EUR")
eur.write({"active": True})
bank = cls.env["res.partner.bank"].create(
{
"acc_number": "NL77ABNA0574908765",
@@ -33,7 +35,7 @@ class TestGenerateBankStatement(SavepointCase):
"code": "TBNKCAMT",
"type": "bank",
"bank_account_id": bank.id,
"currency_id": cls.env.ref("base.EUR").id,
"currency_id": eur.id,
}
)