Quantcast
Channel: OpenERP Help - Individual question feed
Viewing all articles
Browse latest Browse all 6389

How can I pass customs ids to 'datas'

$
0
0
Hello, I am very new with OpenERP and I been trying to make a report to work. Finally I discover that `context.get('active_ids', [])` was returning nothing and thats part of the reason my report was not working. Is there anyway I can pass "custom" ids to datas. Lets say I know the ID in the database and its `22` how can I give it to datas to test if it works? I tried appending `22` but I keep getting an error like the following: except_osv: (u'... must have at least a row and column My code looks like the following def print_report(self,cr,uid,ids,context): if context is None: context = {} datas = {'ids': context.get('active_ids', [])} datas['model'] = 'sim.prov' res = self.read(cr, uid, ids, context=context) res = res and res[0] or {} datas['form'] = res return { 'type': 'ir.actions.report.xml', 'report_name': 'sim.prov', 'datas': datas, } Any tip much appreciated

Viewing all articles
Browse latest Browse all 6389

Trending Articles