Odoo Help


How to fuse custom data and openerp data using jasper parser

on 10/30/13, 5:48 PM 1,357 views
  1. I create my table

    class aim_invoice_report_model(TransientModel):
        _name = 'aim.report.invoice.model'
        _columns = {
            'invoice_id': fields.many2one('account.invoice', 'Invoice', required=True),
            'custom_field1': fields.char(),
  2. I create the data template with a depth of 2 to access the invoice data.

  3. I need to pass the data that fits this template

    def generate_records(...) :
        result = []
        for invoice in invoice_obj.browse(cr, uid, invoice_obj.search(cr, uid, constraints)):
            data = { 'invoice_id': invoice.id, 'custom_field1': 'myvalue' }
        return result

How can I do it ? Using the invoice.id doesnt work.

Thanks for the help or any hints.

EDIT: Looked in jasper_report.py code and found :

# If the language used is xpath create the xmlFile in dataFile.
if self.report.language() == 'xpath':
    if self.data.get('data_source','model') == 'records':
        generator = CsvRecordDataGenerator(self.report, self.data['records'] )
        generator = CsvBrowseDataGenerator( self.report, self.model, self.pool, self.cr, self.uid, self.ids, self.context )
    generator.generate( dataFile )

Doesn't seems to be possible to do what I am trying without modifying jasper_report.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 10/30/13, 5:48 PM
Seen: 1357 times
Last updated: 3/16/15, 8:10 AM