Skip to content

Commit f77c29c

Browse files
[ADD] account_statement_import_ofx_unique_import_id: add new module
1 parent 66d9a81 commit f77c29c

File tree

12 files changed

+541
-0
lines changed

12 files changed

+541
-0
lines changed
+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
=============================================
2+
Account Statement Import Ofx Unique Import Id
3+
=============================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:9610e1c3d5e5b27e06d157abafd39c84b65eaab9d6d1a32e25f214931e7a238d
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-Escodoo%2Faccount--addons-lightgray.png?logo=github
20+
:target: https://github.com/Escodoo/account-addons/tree/14.0/account_statement_import_ofx_unique_import_id
21+
:alt: Escodoo/account-addons
22+
23+
|badge1| |badge2| |badge3|
24+
25+
This module changes the account statement lines `unique_import_id` field for the following format:
26+
- {account number}-{transaction date}-{transaction id}-{transaction label}-{transaction amount}
27+
28+
**Table of contents**
29+
30+
.. contents::
31+
:local:
32+
33+
Bug Tracker
34+
===========
35+
36+
Bugs are tracked on `GitHub Issues <https://github.com/Escodoo/account-addons/issues>`_.
37+
In case of trouble, please check there if your issue has already been reported.
38+
If you spotted it first, help us to smash it by providing a detailed and welcomed
39+
`feedback <https://github.com/Escodoo/account-addons/issues/new?body=module:%20account_statement_import_ofx_unique_import_id%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
40+
41+
Do not contact contributors directly about support or help with technical issues.
42+
43+
Credits
44+
=======
45+
46+
Authors
47+
~~~~~~~
48+
49+
* Escodoo
50+
51+
Contributors
52+
~~~~~~~~~~~~
53+
54+
* `Escodoo <https://www.escodoo.com.br>`_:
55+
56+
* Marcel Savegnago <[email protected]>
57+
* Wesley Oliveira <[email protected]>
58+
59+
Maintainers
60+
~~~~~~~~~~~
61+
62+
This module is part of the `Escodoo/account-addons <https://github.com/Escodoo/account-addons/tree/14.0/account_statement_import_ofx_unique_import_id>`_ project on GitHub.
63+
64+
You are welcome to contribute.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2025 - TODAY, Escodoo
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
{
5+
"name": "Account Statement Import Ofx Unique Import Id",
6+
"summary": """
7+
Account Statement Import OFX Unique Import ID""",
8+
"version": "14.0.1.0.0",
9+
"license": "AGPL-3",
10+
"author": "Escodoo",
11+
"website": "https://github.com/Escodoo/account-addons",
12+
"depends": ["account_statement_import_ofx"],
13+
"data": [],
14+
"demo": [],
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import account_statement_import
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright 2025 - TODAY, Wesley Oliveira <[email protected]>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import api, models
5+
6+
7+
class AccountStatementImport(models.TransientModel):
8+
9+
_inherit = "account.statement.import"
10+
11+
@api.model
12+
def _prepare_ofx_transaction_line(self, transaction):
13+
vals = super()._prepare_ofx_transaction_line(transaction)
14+
15+
transaction_date = transaction.date.strftime("%Y-%m-%d")
16+
unique_import_id = (
17+
f"{transaction_date}-{vals['payment_ref']}-{str(transaction.amount)}"
18+
)
19+
unique_import_id = (
20+
unique_import_id.replace(" ", "").replace(":", "-").replace(".", "")
21+
)
22+
23+
vals["unique_import_id"] = unique_import_id
24+
25+
return vals
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* `Escodoo <https://www.escodoo.com.br>`_:
2+
3+
* Marcel Savegnago <[email protected]>
4+
* Wesley Oliveira <[email protected]>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This module changes the account statement lines `unique_import_id` field for the following format:
2+
- {account number}-{transaction date}-{transaction id}-{transaction label}-{transaction amount}
Loading

0 commit comments

Comments
 (0)