From 43dbca41fa571aebdc5f8e01318dd3f890dc0b6f Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 15 Jun 2015 11:49:43 +0200 Subject: [PATCH] Allow docargs to be loaded from context. --- report_xml/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/report_xml/models.py b/report_xml/models.py index 47e1b874..498346ad 100644 --- a/report_xml/models.py +++ b/report_xml/models.py @@ -89,8 +89,9 @@ class XSDCheckedReport(models.AbstractModel): @api.multi def render_html(self, data=None): """Return the XML report after checking it against an XSD.""" - docargs = {"docs": (self.env[self.env.context["active_model"]] - .browse(self.env.context["active_ids"]))} + docargs = self.env.context.get("docargs", dict()) + docargs["docs"] = (self.env[self.env.context["active_model"]] + .browse(self.env.context["active_ids"])) xsd = etree.XMLSchema(etree.XML(self.xsd())) parser = etree.XMLParser(schema=xsd) result = (self.env["report"]