Skip to content

Commit

Permalink
[IMP] sale_order_import_edifact: support EDI files with no extension
Browse files Browse the repository at this point in the history
  • Loading branch information
nilshamerlinck authored and duongtq committed Oct 26, 2023
1 parent afa72ae commit 204efcd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sale_order_import_edifact/wizard/sale_order_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _compute_edifact_ok(self):
path, ext = os.path.splitext(self.order_filename)
ok = ext and ext[1:] in extensions
if not ok:
ok = b64decode(self.order_file[:4]) == b"UNB"
ok = b64decode(self.order_file[:4]) in (b"UNA", b"UNB")
rec.edifact_ok = ok

def button_parse_order_preview(self):
Expand Down Expand Up @@ -76,7 +76,7 @@ def button_parse_order_preview(self):
def _get_supported_types(self):
# Add more types for EDIFACT
res = super()._get_supported_types()
res.update({"edifact": ("text/plain")})
res.update({"edifact": ("text/plain", None)})
return res

@api.model
Expand Down

0 comments on commit 204efcd

Please sign in to comment.