From 17a07582e26e8599d3ac53caccb790adb1faeb71 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Sat, 30 Jan 2021 18:55:10 +0100 Subject: [PATCH] ebics upload - select default format based upon suffix --- account_ebics/README.rst | 2 +- account_ebics/__manifest__.py | 4 ++-- account_ebics/data/ebics_file_format.xml | 16 ++++++++-------- account_ebics/static/description/index.html | 2 +- account_ebics/wizards/ebics_xfer.py | 15 ++++++++++----- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/account_ebics/README.rst b/account_ebics/README.rst index 170918d..7d390ef 100644 --- a/account_ebics/README.rst +++ b/account_ebics/README.rst @@ -73,7 +73,7 @@ We also recommend to consider the installation of the following modules: The import helper will match the local bank account number with the IBAN number specified on the Odoo Financial journal. - Cf. https://github.com/noviat-apps + Cf. https://github.com/Noviat/noviat-apps | diff --git a/account_ebics/__manifest__.py b/account_ebics/__manifest__.py index f3f2a9b..184eb15 100644 --- a/account_ebics/__manifest__.py +++ b/account_ebics/__manifest__.py @@ -1,9 +1,9 @@ -# Copyright 2009-2020 Noviat. +# Copyright 2009-2021 Noviat. # License LGPL-3 or later (http://www.gnu.org/licenses/lpgl). { 'name': 'EBICS banking protocol', - 'version': '13.0.1.3.0', + 'version': '13.0.1.3.1', 'license': 'LGPL-3', 'author': 'Noviat', 'website': 'www.noviat.com', diff --git a/account_ebics/data/ebics_file_format.xml b/account_ebics/data/ebics_file_format.xml index beeb1bb..e720900 100644 --- a/account_ebics/data/ebics_file_format.xml +++ b/account_ebics/data/ebics_file_format.xml @@ -91,7 +91,7 @@ up FUL Remises de LCR - lcr.dat + txt @@ -99,7 +99,7 @@ up CCT Payment Order in format pain.001.001.03 - cct.xml + xml @@ -107,7 +107,7 @@ up XE2 Payment Order in format pain.001.001.03 - cct.xml + xml @@ -115,7 +115,7 @@ up CDD Sepa Core Direct Debit Order in format pain.008.001.02 - sdd.xml + xml @@ -123,7 +123,7 @@ up XE3 Sepa Core Direct Debit Order in format pain.008.001.02 - sdd.xml + xml @@ -131,7 +131,7 @@ up CDB Sepa Direct Debit (B2B) Order in format pain.008.001.02 - sbb.xml + xml @@ -139,7 +139,7 @@ up XE4 Sepa Direct Debit (B2B) Order in format pain.008.001.02 - sbb.xml + xml @@ -147,7 +147,7 @@ up FUL Payment Order in format pain.001.001.02 - cct.xml + xml diff --git a/account_ebics/static/description/index.html b/account_ebics/static/description/index.html index 42b8115..a2861eb 100644 --- a/account_ebics/static/description/index.html +++ b/account_ebics/static/description/index.html @@ -411,7 +411,7 @@ ul.auto-toc {
  • account_bank_statement_import_helper

    Required if you are processing bank statements with local bank account numbers (e.g. french CFONB files).

    The import helper will match the local bank account number with the IBAN number specified on the Odoo Financial journal.

    -

    Cf. https://github.com/noviat-apps

    +

    Cf. https://github.com/Noviat/noviat-apps

  • diff --git a/account_ebics/wizards/ebics_xfer.py b/account_ebics/wizards/ebics_xfer.py index f2011fd..01e1c48 100644 --- a/account_ebics/wizards/ebics_xfer.py +++ b/account_ebics/wizards/ebics_xfer.py @@ -123,12 +123,17 @@ class EbicsXfer(models.TransientModel): @api.onchange('upload_data') def _onchange_upload_data(self): self.upload_fname_dummy = self.upload_fname + self.format_id = False self._detect_upload_format() - upload_formats = self.format_id \ - or self.ebics_config_id.ebics_file_format_ids.filtered( - lambda r: r.type == 'up') - if len(upload_formats) == 1: - self.format_id = upload_formats + if not self.format_id: + upload_formats = self.format_id \ + or self.ebics_config_id.ebics_file_format_ids.filtered( + lambda r: r.type == 'up') + if len(upload_formats) > 1: + upload_formats = upload_formats.filtered( + lambda r: self.upload_fname.endswith(r.suffix)) + if len(upload_formats) == 1: + self.format_id = upload_formats @api.onchange('format_id') def _onchange_format_id(self):