Skip to content

Commit

Permalink
[MIG] account_statement_import_base: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviedoanhduy committed Nov 6, 2024
1 parent 971ba1a commit 763f0df
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 28 deletions.
18 changes: 11 additions & 7 deletions account_statement_import_base/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ Base module for Bank Statement Import
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-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/17.0/account_statement_import_base
:target: https://github.com/OCA/bank-statement-import/tree/18.0/account_statement_import_base
: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-17-0/bank-statement-import-17-0-account_statement_import_base
:target: https://translation.odoo-community.org/projects/bank-statement-import-18-0/bank-statement-import-18-0-account_statement_import_base
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/bank-statement-import&target_branch=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/bank-statement-import&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This is a technical module designed to share code between 2 other
modules:

- **account_statement_import** that allows to import bank statements
from files,
- **account_statement_import_file** that allows to import bank
statements from files,
- **account_statement_import_online** that allows to import bank
statements from webservices/APIs.

Expand All @@ -47,7 +47,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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/bank-statement-import/issues/new?body=module:%20account_statement_import_base%0Aversion:%2017.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_base%0Aversion:%2018.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.

Expand All @@ -64,6 +64,10 @@ Contributors

- Alexis de Lattre <[email protected]>

- Trobz <https://www.trobz.com/>

- Do Anh Duy <[email protected]>

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

Expand All @@ -85,6 +89,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-alexis-via|

This module is part of the `OCA/bank-statement-import <https://github.com/OCA/bank-statement-import/tree/17.0/account_statement_import_base>`_ project on GitHub.
This module is part of the `OCA/bank-statement-import <https://github.com/OCA/bank-statement-import/tree/18.0/account_statement_import_base>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion account_statement_import_base/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Base module for Bank Statement Import",
"category": "Accounting",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"license": "LGPL-3",
"depends": ["account_statement_base"],
"author": "Akretion, Odoo Community Association (OCA)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class AccountBankStatementLine(models.Model):

# Ensure transactions can be imported only once
# if the import format provides unique transaction IDs
unique_import_id = fields.Char(string="Import ID", readonly=True, copy=False)
raw_data = fields.Text(readonly=True, copy=False)
unique_import_id = fields.Char(string="Import ID", copy=False)
raw_data = fields.Text(copy=False)

_sql_constraints = [
(
Expand Down
10 changes: 4 additions & 6 deletions account_statement_import_base/models/account_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,12 @@ def _statement_line_import_update_unique_import_id(
self, st_line_vals, account_number
):
self.ensure_one()
if st_line_vals.get("unique_import_id"):
unique_import_id = st_line_vals.get("unique_import_id")
if unique_import_id:
sanitized_acc_number = self._sanitize_bank_account_number(account_number)
st_line_vals["unique_import_id"] = (
(sanitized_acc_number and sanitized_acc_number + "-" or "")
+ str(self.id)
+ "-"
+ st_line_vals["unique_import_id"]
)
f"{sanitized_acc_number}-" if sanitized_acc_number else ""
) + f"{self.id}-{unique_import_id}"

@api.model
def _sanitize_bank_account_number(self, account_number):
Expand Down
3 changes: 3 additions & 0 deletions account_statement_import_base/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
- Alexis de Lattre \<<[email protected]>\>

- Trobz \<<https://www.trobz.com/>\>
- Do Anh Duy \<<[email protected]>\>
2 changes: 1 addition & 1 deletion account_statement_import_base/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
This is a technical module designed to share code between 2 other
modules:

- **account_statement_import** that allows to import bank statements
- **account_statement_import_file** that allows to import bank statements
from files,
- **account_statement_import_online** that allows to import bank
statements from webservices/APIs.
25 changes: 16 additions & 9 deletions account_statement_import_base/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -368,12 +369,12 @@ <h1 class="title">Base module for Bank Statement Import</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8a0ca56de404b6170ac3b65b4307eebcf333aba95bdd7ae467333cafd5796bde
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/bank-statement-import/tree/17.0/account_statement_import_base"><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 image-reference" href="https://translation.odoo-community.org/projects/bank-statement-import-17-0/bank-statement-import-17-0-account_statement_import_base"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/bank-statement-import&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/bank-statement-import/tree/18.0/account_statement_import_base"><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 image-reference" href="https://translation.odoo-community.org/projects/bank-statement-import-18-0/bank-statement-import-18-0-account_statement_import_base"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/bank-statement-import&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This is a technical module designed to share code between 2 other
modules:</p>
<ul class="simple">
<li><strong>account_statement_import</strong> that allows to import bank statements
from files,</li>
<li><strong>account_statement_import_file</strong> that allows to import bank
statements from files,</li>
<li><strong>account_statement_import_online</strong> that allows to import bank
statements from webservices/APIs.</li>
</ul>
Expand All @@ -394,7 +395,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
<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 to smash 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_base%0Aversion:%2017.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_base%0Aversion:%2018.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">
Expand All @@ -409,18 +410,24 @@ <h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<ul class="simple">
<li>Alexis de Lattre &lt;<a class="reference external" href="mailto:alexis.delattre&#64;akretion.com">alexis.delattre&#64;akretion.com</a>&gt;</li>
<li>Trobz &lt;<a class="reference external" href="https://www.trobz.com/">https://www.trobz.com/</a>&gt;<ul>
<li>Do Anh Duy &lt;<a class="reference external" href="mailto:duyda&#64;trobz.com">duyda&#64;trobz.com</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<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>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/alexis-via"><img alt="alexis-via" src="https://github.com/alexis-via.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/17.0/account_statement_import_base">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/18.0/account_statement_import_base">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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
/>
<field name="arch" type="xml">
<group name="tech-fields" position="inside">
<field name="unique_import_id" />
<field name="unique_import_id" readonly="1" />
</group>
<group name="tech-fields" position="after">
<group name="raw_data" string="Raw Data">
<field name="raw_data" nolabel="1" colspan="2" />
<field name="raw_data" nolabel="1" colspan="2" readonly="1" />
</group>
</group>
</field>
Expand Down

0 comments on commit 763f0df

Please sign in to comment.