Skip to content

Commit

Permalink
[FIX] account_facturae_attach_existing_attachment: adapt the attachme…
Browse files Browse the repository at this point in the history
…nt extensions to the formats allowed for Facturae 3.2
  • Loading branch information
FrankC013 committed Sep 25, 2024
1 parent 65c965b commit 12c0e4d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 21 deletions.
1 change: 0 additions & 1 deletion account_facturae_attach_existing_attachment/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from . import models
from . import reports
16 changes: 10 additions & 6 deletions account_facturae_attach_existing_attachment/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ class AccountMove(models.Model):
def _map_format_type_signed_facturaevx(self):
return {
"xlsx": "xls",
"docx": "doc",
"jpeg": "jpg",
"jfif": "jpg",
"png": "jpg",
"tif": "tiff",
}

def get_format_types_facturaevx(self):
Expand Down Expand Up @@ -58,12 +63,11 @@ def _get_facturae_move_attachments(self):
description = attachment.name
content_type = attachment.type

if self.env.context.get("facturae_signed", False):
content_type = self._map_format_type_signed_facturaevx().get(
content_type, content_type
)
if content_type not in self.get_format_types_facturaevx():
continue
content_type = self._map_format_type_signed_facturaevx().get(
content_type, content_type
)
if content_type not in self.get_format_types_facturaevx():
continue

result.append(
{
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 12c0e4d

Please sign in to comment.