Odoo Help

Welcome!

This community 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.

0

Sending information from OpenERP to Ireport By parameter

By
asd
on 2/26/14, 12:59 PM 887 views

Hi,

I have installed OpenErp 6.1 and Ireport 3.7.5.

I can`t send some information from a wizard to Ireport. After reading a lot I could send the Ids of the selected products, but I coldn't send some data that hasn't got a model.

I have this wizard :

class product_catalog_builder(osv.osv_memory):

_name = "product.catalog.builder"
_description = "Product Catalog Builder"

_columns = {
        'price' : fields.selection([('no_price','No price'),('sale_price', 'Sale price'), ('partner_pricelist', 'Partner pricelist')], 'Price', help =''),
        'res_partner_id' : fields.many2one('res.partner','Partner', help=''),
        'cover' : fields.boolean('Add cover', help=''),
        'backcover' : fields.boolean('Add backcocer', help=''),
}        
_defaults = {
             'cover' : lambda *x: 1,
             'backcover' : lambda *x: 1,
}

and i want to send :

'cover': 'backcover' 'price' 'res_partner_id'

For doing that I try this :

def do_catalog(self, cr, uid, ids, context={}):

    catalog_builder = self.browse(cr,uid,ids[0])
    product_ids =context.get('active_ids',False)
    data = {
       'model': 'product.product',
       'ids': product_ids,
       }
    return {
        'type': 'ir.actions.report.xml',
        'report_name': 'pruebas',
        'datas': data,
        'parameters':{
                      'cover':catalog_builder.cover,
                      'backcover':catalog_builder.backcover,
                      'price':catalog_builder.price,
                      'res_partner_id':catalog_builder.res_partner_id.id},

    }

In the report I have a parameter called cover and other called BOOLCOVER:

<parameter name="cover" class="java.lang.Object"/> <parameter name="COVERBOOL" class="java.lang.String"> <defaultvalueexpression> </parameter>

I can't pass that as parameter.

Thanks for your help.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 2/26/14, 12:59 PM
Seen: 887 times
Last updated: 3/16/15, 8:10 AM