Skip to content

Commit 3bd9ed1

Browse files
nilshamerlinckduongtq
authored and
duongtq
committed
[IMP] sale_order_import_edifact: support EDI files with no extension
1 parent 9db1744 commit 3bd9ed1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sale_order_import_edifact/wizard/sale_order_import.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def _compute_edifact_ok(self):
3838
path, ext = os.path.splitext(self.order_filename)
3939
ok = ext and ext[1:] in extensions
4040
if not ok:
41-
ok = b64decode(self.order_file[:4]) == b"UNB"
41+
ok = b64decode(self.order_file[:4]) in (b"UNA", b"UNB")
4242
rec.edifact_ok = ok
4343

4444
# TODO: Move this feature to the base module or to an additional module.
@@ -77,7 +77,7 @@ def button_parse_order_preview(self):
7777
def _get_supported_types(self):
7878
# Add more types for EDIFACT
7979
res = super()._get_supported_types()
80-
res.update({"edifact": ("text/plain")})
80+
res.update({"edifact": ("text/plain", None)})
8181
return res
8282

8383
@api.model

0 commit comments

Comments
 (0)