openerp rml report on temporary table

152 views Asked by At

I'm trying to put some datas into a postgres temporary table, and then extract them via a rml report.

My problem is how to tell to openerp to get datas from these temporary tables instead of the default model, in my case account.invoice.

Thanks a lot for the help.

1

There are 1 answers

0
AudioBubble On BEST ANSWER

I solved my problem. Basically, in the report Class, ex. class account_invoice_custom(report_sxw.rml_parse), I have to update the localcontext dictionary, so every key=>value pair in the object will be callable from the .rml file.

Supposing I want to retrieve an object, myTestObj:

self.localcontext.update({
    'testObj' : myTestObj
})

In the RML report I can access to the object, by

[[ testObj.attribute ]]