summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVo Minh Thu <vmt@openerp.com>2013-03-25 15:32:56 +0100
committerVo Minh Thu <vmt@openerp.com>2013-03-25 15:32:56 +0100
commit2829882389f08ae3ea0e449ca1b5d835bbdc6144 (patch)
tree574f5286ce9d0077dbe776975bdd700a491ebd45
parentcea4c4ff8c10985cb8ba3aa2c915d305a97cb0dc (diff)
[IMP] orm: added a print_report() method.
bzr revid: vmt@openerp.com-20130325143256-f8hw66j09310cgjo
-rw-r--r--openerp/osv/orm.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py
index c6609592e00..69c7498c6b9 100644
--- a/openerp/osv/orm.py
+++ b/openerp/osv/orm.py
@@ -5155,6 +5155,15 @@ class BaseModel(object):
get_xml_id = get_external_id
_get_xml_ids = _get_external_ids
+ def print_report(self, cr, uid, ids, name, data, context=None):
+ """
+ Render the report `name` for the given IDs. The report must be defined
+ for this model, not another.
+ """
+ report = self.pool['ir.actions.report.xml']._lookup_report(cr, name)
+ assert self._name == report.table
+ return report.create(cr, uid, ids, data, context)
+
# Transience
def is_transient(self):
""" Return whether the model is transient.