Browse Source

Allow docargs to be loaded from context.

pull/168/head
Jairo Llopis 10 years ago
committed by Enric Tobella
parent
commit
43dbca41fa
  1. 5
      report_xml/models.py

5
report_xml/models.py

@ -89,8 +89,9 @@ class XSDCheckedReport(models.AbstractModel):
@api.multi @api.multi
def render_html(self, data=None): def render_html(self, data=None):
"""Return the XML report after checking it against an XSD.""" """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())) xsd = etree.XMLSchema(etree.XML(self.xsd()))
parser = etree.XMLParser(schema=xsd) parser = etree.XMLParser(schema=xsd)
result = (self.env["report"] result = (self.env["report"]

Loading…
Cancel
Save