Skip to content

Commit

Permalink
Merge PR #106 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by etobella
  • Loading branch information
OCA-git-bot committed Oct 7, 2024
2 parents d484f0d + 710d81a commit ff73c9b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion edi_oca/models/edi_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,13 @@ def _validate_data(self, exchange_record, value=None, **kw):
if exchange_record.direction == "input" and not exchange_record.exchange_file:
if not exchange_record.type_id.allow_empty_files_on_receive:
raise ValueError(
_("Empty files are not allowed for this exchange type")
_(
"Empty files are not allowed for exchange type %(name)s (%(code)s)"
)
% {
"name": exchange_record.type_id.name,
"code": exchange_record.type_id.code,
}
)

component = self._get_component(exchange_record, "validate")
Expand Down
2 changes: 1 addition & 1 deletion edi_oca/tests/test_backend_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_receive_no_allow_empty_file_record(self):
fake_output="", _edi_receive_break_on_error=False
).exchange_receive(self.record)
# Check the record
msg = "Empty files are not allowed for this exchange type"
msg = "Empty files are not allowed for exchange type"
self.assertIn(msg, self.record.exchange_error)
self.assertEqual(self.record._get_file_content(), "")
self.assertRecordValues(
Expand Down

0 comments on commit ff73c9b

Please sign in to comment.