odooopenerp-7rml

openerp rml report on temporary table


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.


Solution

  • 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 ]]