Skip to content

Commit 135f548

Browse files
committed
fix pr
1 parent 9f0c7b9 commit 135f548

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

edi_exchange_template_oca_json/models/edi_exchange_template_output.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# @author Italo LOPES <italo.lopes@camptocamp.com>
33
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
44

5-
5+
import json
66
from odoo import fields, models
77

88

@@ -42,4 +42,4 @@ def _render_json_values(self, exchange_record, **kw):
4242

4343
def _post_process_json_output(self, output):
4444
"""Post-process JSON output."""
45-
return str(output)
45+
return json.dumps(output)

edi_exchange_template_oca_json/tests/test_edi_backend_output_json.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
44

55

6+
import json
67
from odoo.addons.edi_exchange_template_oca.tests.test_edi_backend_output import (
78
TestEDIBackendOutputBase,
89
)
@@ -53,6 +54,6 @@ def test_00_get_template_json(self):
5354

5455
def test_01_generate_json(self):
5556
self.backend.exchange_generate(self.record_json)
56-
expected = f"{{'name': '{self.partner.name}', 'ref': '{self.partner.ref}'}}"
57+
expected = json.dumps({"name": self.partner.name, "ref": self.partner.ref})
5758
file_content = self.record_json._get_file_content()
5859
self.assertEqual(file_content.strip(), expected)

0 commit comments

Comments
 (0)