[13.0]account_ebics 1.3.0 - generic order type

This commit is contained in:
Luc De Meyer
2020-12-05 18:56:12 +01:00
parent 004f1a1eae
commit 18d4984bf5
8 changed files with 376 additions and 156 deletions

View File

@@ -70,7 +70,7 @@ class EbicsFile(models.Model):
raise UserError(_(
"You can only remove EBICS files in state 'Draft'."))
# execute format specific actions
ff = ebics_file.format_id.name
ff = ebics_file.format_id.download_process_method
if ff in ff_methods:
if ff_methods[ff].get('unlink'):
ff_methods[ff]['unlink'](ebics_file)
@@ -92,7 +92,7 @@ class EbicsFile(models.Model):
self = self.with_context(ctx)
self.note_process = ''
ff_methods = self._file_format_methods()
ff = self.format_id.name
ff = self.format_id.download_process_method
if ff in ff_methods:
if ff_methods[ff].get('process'):
res = ff_methods[ff]['process'](self)
@@ -120,15 +120,18 @@ class EbicsFile(models.Model):
for extra file formats.
"""
res = {
'camt.xxx.cfonb120.stm':
'cfonb120':
{'process': self._process_cfonb120,
'unlink': self._unlink_cfonb120},
'camt.052.001.02.stm':
'camt.052':
{'process': self._process_camt052,
'unlink': self._unlink_camt052},
'camt.053.001.02.stm':
'camt.053':
{'process': self._process_camt053,
'unlink': self._unlink_camt053},
'camt.054':
{'process': self._process_camt054,
'unlink': self._unlink_camt054},
}
return res
@@ -294,6 +297,20 @@ class EbicsFile(models.Model):
"""
pass
@staticmethod
def _process_camt054(self):
import_module = 'account_bank_statement_import_camt_oca'
self._check_import_module(import_module)
return self._process_camt053(self)
@staticmethod
def _unlink_camt054(self):
"""
Placeholder for camt054 specific actions before removing the
EBICS data file and its related bank statements.
"""
pass
@staticmethod
def _process_camt053(self):
import_module = 'account_bank_statement_import_camt%'