Jump to content
We've recently updated our Privacy Statement, available here ×

Sending information from OpenERP to Ireport By parameter


yamaksy

Recommended Posts

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><![CDATA[$P{cover}.toString()]]></defaultValueExpression>
</parameter>
 
I can't pass that as parameter.

Thanks for your help.
Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...