How would one go about passing multiple objects to the reporting engine?
I'm trying to create a custom Invoice report where I need to attach data from other application to be displayed on the invoice. I can get the data into OpenERP server using Web Services but how do I pass it to the reporting engine? Perhaps the
set_context or (self.localcontext.update())
method will be useful here as it allows me to pass custom variables to the report but how would one pass a whole object.
What I'm importing from other application is essentially a massive table with potentially 100's of records that are related to the current partner, I don't need to save it in OpenERP database, simply display it while generating an invoice.
EDIT:
To test the object I have in the parser
class test_invoice(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(test_invoice, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'test_var': 'Worked!',
'get_list': self._get_list,
})
def _get_list(self):
result = []
ress = {'first': '1',
'second': '2',
}
result.append(ress)
return result
and in the rml file
...start of rml file
<section>
<para>
[[ repeatIn(get_list(), 'g')]]
[[ g.first ]]
</para>
</section>
</story>
</document>
but this throws an error "coercing to Unicode: need string or buffer, tuple found". How can we display a custom list in rml?
Thank You.