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

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

By
Charlie
on 2/26/16, 9:58 AM 735 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:

@api.v7

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.

0

Akhil P Sivan

--Akhil P Sivan--
3423
| 5 3 6
Kochi, India
--Akhil P Sivan--

Interested in exploring Odoo both technically & functionality wise.

email-id : akhilpsivan01@gmail.com

Akhil P Sivan
On 2/26/16, 1:09 PM

You may correct it like this:

@api.multi

def print_report(self):

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

0

Axel Mendoza

--Axel Mendoza--
10298
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

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

You will be ok if you remove this code:

@api.v7

short and simple ;)

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

thanks!!

Axel Mendoza
on 2/26/16, 4:22 PM

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

1 follower(s)

Stats

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