mirror of
https://github.com/brain-tec/account_ebics.git
synced 2026-10-17 16:29:06 +00:00
ebics upload - select default format based upon suffix
This commit is contained in:
1 parent
43046664fb
commit
6eacd9036b
4 files changed
+27
-14
No files matched your search
@@ -120,12 +120,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):
|
||||
|
||||
Reference in new issue
Block a user