Browse Source

Allow docargs to be loaded from context.

pull/143/head
Jairo Llopis 10 years ago
committed by etobella
parent
commit
4e01bfa95a
  1. 5
      report_xml/models.py

5
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"]

Loading…
Cancel
Save