OCA reporting engine fork for dev and update.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
789 B

  1. # -*- encoding: utf-8 -*-
  2. # Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
  3. from os import path
  4. from openerp import api, models
  5. class XSDSampleReport(models.AbstractModel):
  6. """This report is checked against an XSD before downloading.
  7. The XML itself is declared in ``./views/res_partner_templates.xml``, and
  8. the XSD can be found in ``./xsd/sample_report.xsd``.
  9. This model's :attr:`._name` must be ``report.<XML ID of template>``.
  10. """
  11. _name = "report.report_xml_sample.xsd_sample_report"
  12. _inherit = "report_xml.xsd_checked_report"
  13. @api.multi
  14. def xsd(self):
  15. """Return the XSD schema contents."""
  16. file = path.join(path.dirname(__file__), "xsd", "sample_report.xsd")
  17. with open(file) as xsd:
  18. return xsd.read()