Odoo Help


TypeError: print_report() takes at least 6 arguments (5 given)

on 2/26/16, 9:58 AM 1,288 views

Hello, I have a button that will print a report ( view Qweb ) but when i press the button to print on the form I get the following message:

TypeError: print_report() takes at least 6 arguments (5 given)

The button that I have in view is as follows:

<button name="print_report" string="Print Service Ticket" type="object" icon="gtk-print"/>

And the function that is used to print is:


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

if context is None:

context = {}

data = {}

data['ids'] = context.get('active_ids', [])

data['model'] = context.get('active_model', 'ir.ui.menu')


return self.pool['report'].get_action(cr, uid, [], 'custom_module.report_pricelist', data=data, context=context)

PLease help me with this. Thanks.

Axel Mendoza
On 2/26/16, 10:53 AM

You will be ok if you remove this code:


short and simple ;)

Jusab Sida (jsi)
on 2/26/16, 4:02 PM


Axel Mendoza
on 2/26/16, 4:22 PM
Akhil P Sivan
On 2/26/16, 1:09 PM

You may correct it like this:


def print_report(self):

  return self.env['report'].get_action(self, 'custom_module.report_pricelist')

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

1 follower(s)


Asked: 2/26/16, 9:58 AM
Seen: 1288 times
Last updated: 2/26/16, 1:09 PM