Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.0][MIG] account_statement_import_base: Migration to 18.0 #735

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
038de8d
Add module account_statement_import_base
alexis-via Aug 7, 2022
801bbb5
[ADD] module account_statement_import_file_reconciliation_widget
alexis-via Aug 9, 2022
40b96bd
[ADD] icon.png
OCA-git-bot Sep 29, 2022
e85d33c
[MIG] account_statement_import_base v14 -> v16
alexis-via Jan 18, 2023
5ab5d93
Added translation using Weblate (Croatian)
badbole Jun 2, 2023
44077b9
Added translation using Weblate (Spanish)
Gelo-fl Jun 2, 2023
08ad038
Translated using Weblate (Croatian)
badbole Jun 2, 2023
6fdc224
Translated using Weblate (Spanish)
Gelo-fl Jun 2, 2023
239cadd
Added translation using Weblate (French)
Jun 8, 2023
5de6505
Translated using Weblate (French)
Jun 8, 2023
36e3031
Added translation using Weblate (Portuguese (Brazil))
adrianojprado Jun 27, 2023
a62a7dc
Translated using Weblate (Portuguese (Brazil))
adrianojprado Jun 27, 2023
1a7b2e2
Update translation files
weblate Oct 9, 2023
7751eb2
Added translation using Weblate (Catalan)
pere-aquarian Nov 18, 2023
5d6d692
Translated using Weblate (Catalan)
pere-aquarian Nov 18, 2023
224362c
[IMP] account_statement_import_base: pre-commit execution
rov-adhoc Dec 15, 2023
44deded
[MIG] account_statement_import_base: Migration to 17.0
rov-adhoc Dec 15, 2023
18656d1
[BOT] post-merge updates
OCA-git-bot Feb 5, 2024
1a13d4b
Added translation using Weblate (Italian)
mymage Feb 7, 2024
1e9904a
Translated using Weblate (Italian)
mymage Feb 7, 2024
d99bcec
Translated using Weblate (Italian)
mymage May 3, 2024
9721a4c
Added translation using Weblate (Chinese (Simplified) (zh_CN))
xtanuiha Jun 12, 2024
ebb7c15
Translated using Weblate (Chinese (Simplified) (zh_CN))
xtanuiha Jun 12, 2024
971ba1a
[IMP] account_statement_import_base: pre-commit auto fixes
xaviedoanhduy Nov 5, 2024
763f0df
[MIG] account_statement_import_base: Migration to 18.0
xaviedoanhduy Nov 6, 2024
6734850
add checklog-odoo.cfg
xaviedoanhduy Nov 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <alexis.delattre@akretion.com>

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

- Do Anh Duy <duyda@trobz.com>

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)
Comment on lines +13 to +14

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to move readonly from here to the view?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, there is a quote in the document, see in: https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-17.0

If a field is marked as readonly=True on the model, it won't be possible to import it through the Odoo import tool, so avoid it as possible and define the readonly attribute on the views instead.


_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 \<<alexis.delattre@akretion.com>\>

- Trobz \<<https://www.trobz.com/>\>
- Do Anh Duy \<<duyda@trobz.com>\>
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 (goodger@python.org)
: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