Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ Available addons
----------------
addon | version | maintainers | summary
--- | --- | --- | ---
[account_ebics](account_ebics/) | 17.0.1.2.2 | | EBICS banking protocol
[account_ebics](account_ebics/) | 17.0.1.3.0 | | EBICS banking protocol
[account_ebics_batch](account_ebics_batch/) | 17.0.1.0.1 | | EBICS Files automated import and processing
[account_ebics_batch_payment](account_ebics_batch_payment/) | 17.0.1.0.3 | | Upload Batch Payment via EBICS
[account_ebics_batch_payment](account_ebics_batch_payment/) | 17.0.1.1.0 | | Upload Batch Payment via EBICS
[account_ebics_oca_statement_import](account_ebics_oca_statement_import/) | 17.0.1.0.1 | | Use OCA Bank Statement Import with account_ebics
[account_ebics_oe](account_ebics_oe/) | 17.0.1.0.0 | | Deploy account_ebics module on Odoo Enterprise
[account_ebics_payment_order](account_ebics_payment_order/) | 17.0.1.1.0 | | Upload Payment Order via EBICS
[account_ebics_payment_order](account_ebics_payment_order/) | 17.0.1.2.0 | | Upload Payment Order via EBICS

[//]: # (end addons)

Expand Down
4 changes: 2 additions & 2 deletions account_ebics/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright 2009-2025 Noviat.
# Copyright 2015 Noviat.
# License LGPL-3 or later (https://www.gnu.org/licenses/lgpl).

{
"name": "EBICS banking protocol",
"version": "17.0.1.2.2",
"version": "17.0.1.3.0",
"license": "LGPL-3",
"author": "Noviat",
"website": "https://www.noviat.com/",
Expand Down
1 change: 1 addition & 0 deletions account_ebics/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from . import fintech_ebics_register
from . import account_bank_statement
from . import account_journal
from . import ebics_config
from . import ebics_file
from . import ebics_file_format
Expand Down
26 changes: 26 additions & 0 deletions account_ebics/models/account_journal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2026 Noviat.
# License LGPL-3 or later (https://www.gnu.org/licenses/lgpl).

from odoo import api, fields, models


class AccountJournal(models.Model):
_inherit = "account.journal"

ebics_config_ids = fields.Many2many(
comodel_name="ebics.config",
relation="account_journal_ebics_config_rel",
readonly=True,
)
ebics_config_id = fields.Many2one(
comodel_name="ebics.config",
compute="_compute_ebics_config_id",
compute_sudo=True,
)

@api.depends("ebics_config_ids")
def _compute_ebics_config_id(self):
for rec in self:
rec.ebics_config_id = rec.ebics_config_ids.filtered(
lambda r: r.state == "confirm"
)[:1]
25 changes: 5 additions & 20 deletions account_ebics/models/ebics_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ class EbicsConfig(models.Model):
comodel_name="res.company",
relation="ebics_config_res_company_rel",
string="Companies",
readonly=True,
compute="_compute_company_ids",
store=True,
help="Companies sharing this EBICS contract.",
)

Expand Down Expand Up @@ -154,26 +155,10 @@ def _check_order_number(self):
)
)

def write(self, vals):
"""
Due to the multi-company nature of the EBICS config we
need to adapt the company_ids in the write method.
"""
if "journal_ids" not in vals:
return super().write(vals)
@api.depends("journal_ids.company_id")
def _compute_company_ids(self):
for rec in self:
old_company_ids = rec.journal_ids.mapped("company_id").ids
super(EbicsConfig, rec).write(vals)
new_company_ids = rec.journal_ids.mapped("company_id").ids
updates = []
for cid in new_company_ids:
if cid in old_company_ids:
old_company_ids.remove(cid)
else:
updates += [(4, cid)]
updates += [(3, x) for x in old_company_ids]
super(EbicsConfig, rec).write({"company_ids": updates})
return True
rec.company_ids = rec.journal_ids.mapped("company_id")

def unlink(self):
for ebics_config in self:
Expand Down
9 changes: 9 additions & 0 deletions account_ebics/views/menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,13 @@
sequence="30"
/>

<menuitem
id="ebics_xfer_menu_mark_as_downloaded"
name="Mark files as Downloaded"
parent="ebics_menu"
action="account_ebics.ebics_xfer_action_mark_as_downloaded"
groups="account_ebics.group_ebics_manager"
sequence="40"
/>

</odoo>
9 changes: 5 additions & 4 deletions account_ebics/wizards/ebics_xfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ def ebics_download(self):
date_from = self.date_from and self.date_from.isoformat() or None
date_to = self.date_to and self.date_to.isoformat() or None
for df in download_formats:
success = False
try:
success = False
if df.order_type == "BTD":
btf = BusinessTransactionFormat(
df.btf_service,
Expand All @@ -263,7 +263,8 @@ def ebics_download(self):
}
}
data = client.download(df.order_type, params=params)
ebics_files += self._handle_download_data(data, df)
if not self.env.context.get("ebics_mark_as_downloaded"):
ebics_files += self._handle_download_data(data, df)
success = True
except EbicsFunctionalError:
err_cnt += 1
Expand Down Expand Up @@ -321,8 +322,8 @@ def ebics_download(self):
order_type=df.order_type,
)
tb = "".join(format_exception(*exc_info()))
self.note += "\n%s" % tb
else:
self.note += f"\n{tb}"
finally:
# mark received data so that it is not included in further
# downloads
trans_id = client.last_trans_id
Expand Down
Loading
Loading