forked from acsone/reporting-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
24 lines (18 loc) · 789 Bytes
/
models.py
File metadata and controls
24 lines (18 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*- encoding: utf-8 -*-
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
from os import path
from openerp import api, models
class XSDSampleReport(models.AbstractModel):
"""This report is checked against an XSD before downloading.
The XML itself is declared in ``./views/res_partner_templates.xml``, and
the XSD can be found in ``./xsd/sample_report.xsd``.
This model's :attr:`._name` must be ``report.<XML ID of template>``.
"""
_name = "report.report_xml_sample.xsd_sample_report"
_inherit = "report_xml.xsd_checked_report"
@api.multi
def xsd(self):
"""Return the XSD schema contents."""
file = path.join(path.dirname(__file__), "xsd", "sample_report.xsd")
with open(file) as xsd:
return xsd.read()