[IMP] report_xml: black, isort, prettier

This commit is contained in:
Atte Isopuro
2021-11-25 14:35:47 +02:00
committed by Du-ma
parent eda0ad73a9
commit 8eee1e4e6d
2 changed files with 6 additions and 3 deletions

View File

@@ -32,7 +32,7 @@ class ReportController(report.ReportController):
del data["context"]["lang"]
context.update(data["context"])
xml = report.with_context(context)._render_qweb_xml(docids, data=data)[0]
xml = report.with_context(**context)._render_qweb_xml(docids, data=data)[0]
xmlhttpheaders = [
("Content-Type", "text/xml"),
("Content-Length", len(xml)),
@@ -56,7 +56,10 @@ class ReportController(report.ReportController):
if docids:
# Generic report:
response = self.report_routes(
reportname, docids=docids, converter="xml", context=context
reportname,
docids=docids,
converter="xml",
context=context,
)
else:
# Particular report:

View File

@@ -103,7 +103,7 @@ class ReportXmlAbstract(models.AbstractModel):
# check content
etree.fromstring(content, parser)
except etree.XMLSyntaxError as error:
raise ValidationError(error.msg)
raise ValidationError(error.msg) from error
return True
@api.model