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

'__' object has no attribute 'cr'

By
Elmasry
on 6/18/13, 9:13 AM 1,565 views

hi i use this code to make a query to print report

def print_report(self, cr, uid, ids, context=None):

        form_data = self.read(cr, uid, ids)

        cr.execute("SELECT * \
                FROM stock_move ")
        res = self.cr.dictfetchall()
        idp = self.pool.get('stock.move').search(cr, uid, [], context=context)
        datas = {
             'ids': idp,
             'model': 'product.product',
             'form': form_data,
            'query': res,
        }

        return {
                'name': 'Current Inventory',
                'res_model': 'stock.move',
                'context': context,
            'type': 'ir.actions.report.xml',
            'report_name': 'moves.report.viera',
            'datas': datas,
        }

but i have this error

'moves_report' object has no attribute 'cr'

1

Borni DHIFI

--Borni DHIFI--
5102
| 6 8 9
Tunis, Tunisia
--Borni DHIFI--

Techno Functional Consultant Odoo(OpenERP) 

http://www.linkedin.com/in/borni

Skype : dhifi.borni

Borni DHIFI
On 6/18/13, 9:18 AM

Hi,

replace

res = self.cr.dictfetchall()

with

res = cr.dictfetchall()

الحمد لله ... واشكرك يا اخى

Elmasry
on 6/18/13, 9:30 AM

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: 6/18/13, 9:13 AM
Seen: 1565 times
Last updated: 3/16/15, 8:10 AM