Merge pull request #85 from Noviat/19.0

Syncing from upstream Noviat/account_ebics (19.0)
This commit is contained in:
braintec
2026-04-18 01:13:59 +02:00
committed by GitHub
14 changed files with 273 additions and 37 deletions

View File

@@ -177,6 +177,7 @@ msgstr ""
#. module: account_ebics
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_change_passphrase_view_form
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_download
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_mark_as_downloaded
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_upload
msgid "Cancel"
msgstr ""
@@ -311,6 +312,7 @@ msgstr ""
#. module: account_ebics
#: model:ir.model.fields,field_description:account_ebics.field_account_bank_statement__display_name
#: model:ir.model.fields,field_description:account_ebics.field_account_journal__display_name
#: model:ir.model.fields,field_description:account_ebics.field_ebics_admin_order__display_name
#: model:ir.model.fields,field_description:account_ebics.field_ebics_change_passphrase__display_name
#: model:ir.model.fields,field_description:account_ebics.field_ebics_config__display_name
@@ -602,6 +604,11 @@ msgstr ""
msgid "EBICS Manager"
msgstr ""
#. module: account_ebics
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_mark_as_downloaded
msgid "EBICS Mark as Downloaded"
msgstr ""
#. module: account_ebics
#. odoo-python
#: code:addons/account_ebics/wizards/ebics_xfer.py:0
@@ -789,6 +796,12 @@ msgstr ""
msgid "EBICS version mismatch."
msgstr ""
#. module: account_ebics
#: model:ir.model.fields,field_description:account_ebics.field_account_journal__ebics_config_id
#: model:ir.model.fields,field_description:account_ebics.field_account_journal__ebics_config_ids
msgid "Ebics Config"
msgstr ""
#. module: account_ebics
#: model:ir.model.fields,field_description:account_ebics.field_ebics_userid__ebics_keys_fn
msgid "Ebics Keys Fn"
@@ -947,6 +960,7 @@ msgstr ""
#. module: account_ebics
#: model:ir.model.fields,field_description:account_ebics.field_account_bank_statement__id
#: model:ir.model.fields,field_description:account_ebics.field_account_journal__id
#: model:ir.model.fields,field_description:account_ebics.field_ebics_admin_order__id
#: model:ir.model.fields,field_description:account_ebics.field_ebics_change_passphrase__id
#: model:ir.model.fields,field_description:account_ebics.field_ebics_config__id
@@ -1008,6 +1022,11 @@ msgstr ""
msgid "Invalid XML file."
msgstr ""
#. module: account_ebics
#: model:ir.model,name:account_ebics.model_account_journal
msgid "Journal"
msgstr ""
#. module: account_ebics
#: model:ir.model.fields,field_description:account_ebics.field_ebics_admin_order__write_uid
#: model:ir.model.fields,field_description:account_ebics.field_ebics_change_passphrase__write_uid
@@ -1035,6 +1054,17 @@ msgstr ""
msgid "Locality Name [L]"
msgstr ""
#. module: account_ebics
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_mark_as_downloaded
msgid "Mark as Downloaded"
msgstr ""
#. module: account_ebics
#: model:ir.actions.act_window,name:account_ebics.ebics_xfer_action_mark_as_downloaded
#: model:ir.ui.menu,name:account_ebics.ebics_xfer_menu_mark_as_downloaded
msgid "Mark files as Downloaded"
msgstr ""
#. module: account_ebics
#: model:ir.model.fields,help:account_ebics.field_ebics_file_format__btf_format
msgid ""
@@ -1288,6 +1318,7 @@ msgstr ""
#. module: account_ebics
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_download
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_mark_as_downloaded
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_upload
msgid "Select your bank :"
msgstr ""
@@ -1437,6 +1468,14 @@ msgstr ""
msgid "Test Mode"
msgstr ""
#. module: account_ebics
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_mark_as_downloaded
msgid ""
"The EBICS Files (Bank Statements) selected via this screen will not become available in Odoo as EBICS files but will be marked by your bank as downloaded.\n"
" <br/>\n"
" As a consequence, these Bank Statements will not be retrieved by the next 'EBICS Batch Import' scheduled action."
msgstr ""
#. module: account_ebics
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_config_view_form
msgid ""

View File

@@ -186,6 +186,7 @@ msgstr "Relevés"
#. module: account_ebics
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_change_passphrase_view_form
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_download
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_mark_as_downloaded
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_upload
msgid "Cancel"
msgstr "Annuler"
@@ -321,6 +322,7 @@ msgstr "Description"
#. module: account_ebics
#: model:ir.model.fields,field_description:account_ebics.field_account_bank_statement__display_name
#: model:ir.model.fields,field_description:account_ebics.field_account_journal__display_name
#: model:ir.model.fields,field_description:account_ebics.field_ebics_admin_order__display_name
#: model:ir.model.fields,field_description:account_ebics.field_ebics_change_passphrase__display_name
#: model:ir.model.fields,field_description:account_ebics.field_ebics_config__display_name
@@ -617,6 +619,11 @@ msgstr ""
msgid "EBICS Manager"
msgstr ""
#. module: account_ebics
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_mark_as_downloaded
msgid "EBICS Mark as Downloaded"
msgstr ""
#. module: account_ebics
#. odoo-python
#: code:addons/account_ebics/wizards/ebics_xfer.py:0
@@ -804,6 +811,12 @@ msgstr ""
msgid "EBICS version mismatch."
msgstr ""
#. module: account_ebics
#: model:ir.model.fields,field_description:account_ebics.field_account_journal__ebics_config_id
#: model:ir.model.fields,field_description:account_ebics.field_account_journal__ebics_config_ids
msgid "Ebics Config"
msgstr ""
#. module: account_ebics
#: model:ir.model.fields,field_description:account_ebics.field_ebics_userid__ebics_keys_fn
msgid "Ebics Keys Fn"
@@ -965,6 +978,7 @@ msgstr ""
#. module: account_ebics
#: model:ir.model.fields,field_description:account_ebics.field_account_bank_statement__id
#: model:ir.model.fields,field_description:account_ebics.field_account_journal__id
#: model:ir.model.fields,field_description:account_ebics.field_ebics_admin_order__id
#: model:ir.model.fields,field_description:account_ebics.field_ebics_change_passphrase__id
#: model:ir.model.fields,field_description:account_ebics.field_ebics_config__id
@@ -1026,6 +1040,11 @@ msgstr ""
msgid "Invalid XML file."
msgstr ""
#. module: account_ebics
#: model:ir.model,name:account_ebics.model_account_journal
msgid "Journal"
msgstr ""
#. module: account_ebics
#: model:ir.model.fields,field_description:account_ebics.field_ebics_admin_order__write_uid
#: model:ir.model.fields,field_description:account_ebics.field_ebics_change_passphrase__write_uid
@@ -1053,6 +1072,17 @@ msgstr "Dernière mise à jour le"
msgid "Locality Name [L]"
msgstr ""
#. module: account_ebics
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_mark_as_downloaded
msgid "Mark as Downloaded"
msgstr ""
#. module: account_ebics
#: model:ir.actions.act_window,name:account_ebics.ebics_xfer_action_mark_as_downloaded
#: model:ir.ui.menu,name:account_ebics.ebics_xfer_menu_mark_as_downloaded
msgid "Mark files as Downloaded"
msgstr ""
#. module: account_ebics
#: model:ir.model.fields,help:account_ebics.field_ebics_file_format__btf_format
msgid ""
@@ -1312,6 +1342,7 @@ msgstr ""
#. module: account_ebics
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_download
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_mark_as_downloaded
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_upload
msgid "Select your bank :"
msgstr ""
@@ -1461,6 +1492,17 @@ msgstr ""
msgid "Test Mode"
msgstr "Mode de test"
#. module: account_ebics
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_mark_as_downloaded
msgid ""
"The EBICS Files (Bank Statements) selected via this screen will not become "
"available in Odoo as EBICS files but will be marked by your bank as "
"downloaded.\n"
" <br/>\n"
" As a consequence, these Bank Statements will not be "
"retrieved by the next 'EBICS Batch Import' scheduled action."
msgstr ""
#. module: account_ebics
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_config_view_form
msgid ""

View File

@@ -186,6 +186,7 @@ msgstr "Afschriften"
#. module: account_ebics
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_change_passphrase_view_form
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_download
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_mark_as_downloaded
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_upload
msgid "Cancel"
msgstr "Annuleer"
@@ -321,6 +322,7 @@ msgstr "Omschrijving"
#. module: account_ebics
#: model:ir.model.fields,field_description:account_ebics.field_account_bank_statement__display_name
#: model:ir.model.fields,field_description:account_ebics.field_account_journal__display_name
#: model:ir.model.fields,field_description:account_ebics.field_ebics_admin_order__display_name
#: model:ir.model.fields,field_description:account_ebics.field_ebics_change_passphrase__display_name
#: model:ir.model.fields,field_description:account_ebics.field_ebics_config__display_name
@@ -617,6 +619,11 @@ msgstr ""
msgid "EBICS Manager"
msgstr ""
#. module: account_ebics
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_mark_as_downloaded
msgid "EBICS Mark as Downloaded"
msgstr ""
#. module: account_ebics
#. odoo-python
#: code:addons/account_ebics/wizards/ebics_xfer.py:0
@@ -804,6 +811,12 @@ msgstr ""
msgid "EBICS version mismatch."
msgstr ""
#. module: account_ebics
#: model:ir.model.fields,field_description:account_ebics.field_account_journal__ebics_config_id
#: model:ir.model.fields,field_description:account_ebics.field_account_journal__ebics_config_ids
msgid "Ebics Config"
msgstr ""
#. module: account_ebics
#: model:ir.model.fields,field_description:account_ebics.field_ebics_userid__ebics_keys_fn
msgid "Ebics Keys Fn"
@@ -965,6 +978,7 @@ msgstr ""
#. module: account_ebics
#: model:ir.model.fields,field_description:account_ebics.field_account_bank_statement__id
#: model:ir.model.fields,field_description:account_ebics.field_account_journal__id
#: model:ir.model.fields,field_description:account_ebics.field_ebics_admin_order__id
#: model:ir.model.fields,field_description:account_ebics.field_ebics_change_passphrase__id
#: model:ir.model.fields,field_description:account_ebics.field_ebics_config__id
@@ -1026,6 +1040,11 @@ msgstr ""
msgid "Invalid XML file."
msgstr ""
#. module: account_ebics
#: model:ir.model,name:account_ebics.model_account_journal
msgid "Journal"
msgstr ""
#. module: account_ebics
#: model:ir.model.fields,field_description:account_ebics.field_ebics_admin_order__write_uid
#: model:ir.model.fields,field_description:account_ebics.field_ebics_change_passphrase__write_uid
@@ -1053,6 +1072,17 @@ msgstr "Laatst bijgewerkt op"
msgid "Locality Name [L]"
msgstr ""
#. module: account_ebics
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_mark_as_downloaded
msgid "Mark as Downloaded"
msgstr ""
#. module: account_ebics
#: model:ir.actions.act_window,name:account_ebics.ebics_xfer_action_mark_as_downloaded
#: model:ir.ui.menu,name:account_ebics.ebics_xfer_menu_mark_as_downloaded
msgid "Mark files as Downloaded"
msgstr ""
#. module: account_ebics
#: model:ir.model.fields,help:account_ebics.field_ebics_file_format__btf_format
msgid ""
@@ -1312,6 +1342,7 @@ msgstr ""
#. module: account_ebics
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_download
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_mark_as_downloaded
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_upload
msgid "Select your bank :"
msgstr ""
@@ -1461,6 +1492,17 @@ msgstr ""
msgid "Test Mode"
msgstr ""
#. module: account_ebics
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_xfer_view_form_mark_as_downloaded
msgid ""
"The EBICS Files (Bank Statements) selected via this screen will not become "
"available in Odoo as EBICS files but will be marked by your bank as "
"downloaded.\n"
" <br/>\n"
" As a consequence, these Bank Statements will not be "
"retrieved by the next 'EBICS Batch Import' scheduled action."
msgstr ""
#. module: account_ebics
#: model_terms:ir.ui.view,arch_db:account_ebics.ebics_config_view_form
msgid ""

View File

@@ -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

View File

@@ -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]

View File

@@ -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.",
)
@@ -154,6 +155,11 @@ class EbicsConfig(models.Model):
)
)
@api.depends("journal_ids.company_id")
def _compute_company_ids(self):
for rec in self:
rec.company_ids = rec.journal_ids.mapped("company_id")
@api.ondelete(at_uninstall=False)
def _unlink_except_confirm(self):
if any(rec.state == "confirm" for rec in self):
@@ -161,27 +167,6 @@ class EbicsConfig(models.Model):
self.env._("You cannot remove active EBICS configurations.")
)
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)
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
def set_to_draft(self):
return self.write({"state": "draft"})

View File

@@ -80,4 +80,13 @@
groups="account_ebics.group_ebics_manager"
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>

View File

@@ -236,8 +236,8 @@ class EbicsXfer(models.TransientModel):
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:
try:
success = False
try:
if df.order_type == "BTD":
btf = BusinessTransactionFormat(
df.btf_service,
@@ -262,6 +262,7 @@ class EbicsXfer(models.TransientModel):
}
}
data = client.download(df.order_type, params=params)
if not self.env.context.get("ebics_mark_as_downloaded"):
ebics_files += self._handle_download_data(data, df)
success = True
except EbicsFunctionalError:
@@ -321,7 +322,7 @@ class EbicsXfer(models.TransientModel):
)
tb = "".join(format_exception(*exc_info()))
self.note += f"\n{tb}"
else:
finally:
# mark received data so that it is not included in further
# downloads
trans_id = client.last_trans_id

View File

@@ -164,4 +164,73 @@
<field name="context">{'ebics_upload': 1}</field>
<field name="view_id" ref="ebics_xfer_view_form_upload" />
</record>
<record id="ebics_xfer_view_form_mark_as_downloaded" model="ir.ui.view">
<field name="name">Mark EBICS files as Downloaded</field>
<field name="model">ebics.xfer</field>
<field name="priority" eval="100" />
<field name="arch" type="xml">
<form string="EBICS Mark as Downloaded">
<div class="alert alert-warning" role="alert">
The EBICS Files (Bank Statements) selected via this screen will not become available in Odoo as EBICS files but will be marked by your bank as downloaded.
<br />
As a consequence, these Bank Statements will not be retrieved by the next 'EBICS Batch Import' scheduled action.
</div>
<group>
<separator string="Select your bank :" colspan="2" />
<field
name="ebics_config_id"
required="1"
options="{'no_create': True, 'no_open': True}"
/>
<field
name="ebics_userid_id"
domain="[('ebics_config_id', '=', ebics_config_id), ('user_ids.id', '=', uid), ('transaction_rights', 'in', ['both', 'down'])]"
required="1"
options="{'no_create': True, 'no_open': True}"
/>
<field
name="ebics_passphrase"
password="True"
invisible="ebics_passphrase_store"
required="not ebics_passphrase_store"
/>
<field name="date_from" required="1" />
<field name="date_to" required="1" />
<field
name="format_id"
required="1"
domain="[('type', '=', 'down'), ('id', 'in', allowed_format_ids)]"
/>
</group>
<footer>
<button
name="ebics_download"
string="Mark as Downloaded"
type="object"
class="btn-primary"
data-hotkey="q"
/>
<button
string="Cancel"
class="btn-secondary"
special="cancel"
data-hotkey="z"
/>
</footer>
</form>
</field>
</record>
<record id="ebics_xfer_action_mark_as_downloaded" model="ir.actions.act_window">
<field name="name">Mark files as Downloaded</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ebics.xfer</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field
name="context"
>{'ebics_download': 1, 'ebics_mark_as_downloaded': 1}</field>
<field name="view_id" ref="ebics_xfer_view_form_mark_as_downloaded" />
</record>
</odoo>

View File

@@ -32,6 +32,11 @@ msgstr ""
msgid "EBICS Upload"
msgstr ""
#. module: account_ebics_batch_payment
#: model:ir.model.fields,field_description:account_ebics_batch_payment.field_account_batch_payment__hide_ebics_upload
msgid "Hide Ebics Upload"
msgstr ""
#. module: account_ebics_batch_payment
#: model:ir.model.fields,field_description:account_ebics_batch_payment.field_account_batch_payment__id
msgid "ID"

View File

@@ -39,6 +39,11 @@ msgstr ""
msgid "EBICS Upload"
msgstr ""
#. module: account_ebics_batch_payment
#: model:ir.model.fields,field_description:account_ebics_batch_payment.field_account_batch_payment__hide_ebics_upload
msgid "Hide Ebics Upload"
msgstr ""
#. module: account_ebics_batch_payment
#: model:ir.model.fields,field_description:account_ebics_batch_payment.field_account_batch_payment__id
msgid "ID"

View File

@@ -39,6 +39,11 @@ msgstr ""
msgid "EBICS Upload"
msgstr ""
#. module: account_ebics_batch_payment
#: model:ir.model.fields,field_description:account_ebics_batch_payment.field_account_batch_payment__hide_ebics_upload
msgid "Hide Ebics Upload"
msgstr ""
#. module: account_ebics_batch_payment
#: model:ir.model.fields,field_description:account_ebics_batch_payment.field_account_batch_payment__id
msgid "ID"

View File

@@ -1,34 +1,40 @@
# Copyright 2020 Noviat.
# License LGPL-3 or later (https://www.gnu.org/licenses/lgpl).
from odoo import models
from odoo import api, fields, models
from odoo.exceptions import UserError
class AccountBatchPayment(models.Model):
_inherit = "account.batch.payment"
hide_ebics_upload = fields.Boolean(
compute="_compute_hide_ebics_upload", default=True
)
@api.depends("journal_id.ebics_config_id", "file_generation_enabled", "state")
def _compute_hide_ebics_upload(self):
for rec in self:
rec.hide_ebics_upload = (
not rec.journal_id.ebics_config_id
or not rec.file_generation_enabled
or rec.state != "sent"
)
def ebics_upload(self):
self.ensure_one()
ctx = self.env.context.copy()
origin = self.env._("Batch Payment") + ": " + self.name
ebics_config = self.env["ebics.config"].search(
[
("journal_ids", "=", self.journal_id.id),
("state", "=", "confirm"),
]
)
if not ebics_config:
if not self.journal_id.ebics_config_id:
raise UserError(
self.env._(
"No active EBICS configuration available for the selected bank."
)
)
if len(ebics_config) == 1:
ctx["default_ebics_config_id"] = ebics_config.id
ctx.update(
{
"default_ebics_config_id": self.journal_id.ebics_config_id.id,
"default_upload_data": self.export_file,
"default_upload_fname": self.export_filename,
"origin": origin,

View File

@@ -5,12 +5,13 @@
<field name="model">account.batch.payment</field>
<field name="inherit_id" ref="account_batch_payment.view_batch_payment_form" />
<field name="arch" type="xml">
<button name="validate_batch_button" position="after">
<button id="print_button" position="before">
<button
name="ebics_upload"
type="object"
invisible="not file_generation_enabled or state != 'sent'"
invisible="hide_ebics_upload"
string="EBICS Upload"
class="oe_highlight"
/>
</button>
</field>