[IMP] orm: added a print_report() method.

bzr revid: vmt@openerp.com-20130325143256-f8hw66j09310cgjo
This commit is contained in:
Vo Minh Thu 2013-03-25 15:32:56 +01:00
parent cea4c4ff8c
commit 2829882389
1 changed files with 9 additions and 0 deletions

View File

@ -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.