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 9db1744 commit 3bd9ed1
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

Check warning on line 39 in sale_order_import_edifact/wizard/sale_order_import.py

View check run for this annotation

Codecov / codecov/patch

sale_order_import_edifact/wizard/sale_order_import.py#L35-L39

Added lines #L35 - L39 were not covered by tests
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

Check warning on line 42 in sale_order_import_edifact/wizard/sale_order_import.py

View check run for this annotation

Codecov / codecov/patch

sale_order_import_edifact/wizard/sale_order_import.py#L41-L42

Added lines #L41 - L42 were not covered by tests

# TODO: Move this feature to the base module or to an additional module.
Expand Down Expand Up @@ -77,7 +77,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 3bd9ed1

Please sign in to comment.