Merge pull request #72 from Noviat/16-small-changes

16 small changes
This commit is contained in:
Luc De Meyer 2023-03-07 16:58:43 +01:00 committed by GitHub
commit c36fb9c4e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -114,5 +114,7 @@ class EbicsFileFormat(models.Model):
res = [] res = []
for rec in self: for rec in self:
name = rec.ebics_version == "2" and rec.name or rec.btf_message name = rec.ebics_version == "2" and rec.name or rec.btf_message
if rec.description:
name += " - " + rec.description
res.append((rec.id, name)) res.append((rec.id, name))
return res return res

View File

@ -152,7 +152,7 @@ class EbicsXfer(models.TransientModel):
) )
if len(upload_formats) > 1: if len(upload_formats) > 1:
upload_formats = upload_formats.filtered( upload_formats = upload_formats.filtered(
lambda r: self.upload_fname.endswith(r.suffix) lambda r: self.upload_fname.endswith(r.suffix or "")
) )
if len(upload_formats) == 1: if len(upload_formats) == 1:
self.format_id = upload_formats self.format_id = upload_formats