mirror of
https://github.com/brain-tec/account_ebics.git
synced 2025-08-02 16:59:20 +00:00
improved support empty statements and oca camt parser
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Copyright 2009-2018 Noviat.
|
||||
# Copyright 2009-2019 Noviat.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
"""
|
||||
@@ -288,7 +288,7 @@ class EbicsConfig(models.Model):
|
||||
user = EbicsUser(
|
||||
keyring=keyring, partnerid=self.ebics_partner,
|
||||
userid=self.ebics_user)
|
||||
except:
|
||||
except Exception:
|
||||
exctype, value = exc_info()[:2]
|
||||
error = _("EBICS Initialisation Error:")
|
||||
error += '\n' + str(exctype) + '\n' + str(value)
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Copyright 2009-2018 Noviat.
|
||||
# Copyright 2009-2019 Noviat.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
import logging
|
||||
@@ -136,7 +136,7 @@ class EbicsFile(models.Model):
|
||||
|
||||
def _check_import_module(self, module):
|
||||
mod = self.env['ir.module.module'].search(
|
||||
[('name', '=', module),
|
||||
[('name', '=like', module),
|
||||
('state', '=', 'installed')])
|
||||
if not mod:
|
||||
raise UserError(_(
|
||||
@@ -207,14 +207,15 @@ class EbicsFile(models.Model):
|
||||
|
||||
@staticmethod
|
||||
def _process_camt053(self):
|
||||
import_module = 'account_bank_statement_import_camt'
|
||||
import_module = 'account_bank_statement_import_camt%'
|
||||
self._check_import_module(import_module)
|
||||
wiz_model = 'account.bank.statement.import'
|
||||
wiz_vals = {
|
||||
'data_file': self.data,
|
||||
'filename': self.name,
|
||||
}
|
||||
wiz = self.env[wiz_model].create(wiz_vals)
|
||||
ctx = dict(self.env.context, active_model='ebics.file')
|
||||
wiz = self.env[wiz_model].with_context(ctx).create(wiz_vals)
|
||||
res = wiz.import_file()
|
||||
if res.get('res_model') \
|
||||
== 'account.bank.statement.import.journal.creation':
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Copyright 2009-2018 Noviat.
|
||||
# Copyright 2009-2019 Noviat.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
import logging
|
||||
@@ -32,7 +32,7 @@ except RuntimeError as e:
|
||||
else:
|
||||
_logger.error(e.message)
|
||||
fintech.register()
|
||||
except:
|
||||
except Exception:
|
||||
msg = "fintech.register error"
|
||||
tb = ''.join(format_exception(*exc_info()))
|
||||
msg += '\n%s' % tb
|
||||
|
Reference in New Issue
Block a user