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

Resolving this TypeError: onchange_partner_id() takes exactly 5 arguments (6 given)

By
Sandro Regis
on 3/28/13, 11:29 AM 4,137 views

Please, could some friend explain to me how to solve this issue?

v6.1/openerp-br/addons/project_timesheet/project_timesheet.py", line 33, in onchange_partner_id res = super(project_project, self).onchange_partner_id(cr, uid, ids, part, context) TypeError: onchange_partner_id() takes exactly 5 arguments (6 given)

I really apreciate some guidance!

Best regards,

Sandro Regis

1
Sandro Regis
On 3/28/13, 12:54 PM

Hello friends, it was solve this way:

def onchange_partner_id(self, cr, uid, ids, part=False, context=None):
    #res = super(project_project, self).onchange_partner_id(self, cr, uid, ids, part, context)
    '''The part and context parameters was removed'''
    res = super(project_project, self).onchange_partner_id(self, cr, uid, ids)

Thank you all!

0

Francesco OpenCode

--Francesco OpenCode--
3608
| 5 7 9
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo (OpenERP) Modules Developer LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode
On 3/28/13, 11:39 AM

Your function must be:

res = super(project_project, self).onchange_partner_id(self, cr, uid, ids, part, context):
0
Lucio
On 3/28/13, 12:33 PM

Hello! I am assuming you have something like:

def onchange_partner_id(self, cr, uid, ids, part, context=None):
    if context is None:
        context = {}
    res = super(project_project, self).onchange_partner_id(cr, uid, ids, part, context=context)
    ...
    return res

If this is so, probably the problem is in the .xml. In the field where you put the on_change=onchange_partner_id(...), probably you have some other argument besides partner_id (assuming that this is the name of the field that you want to use), maybe context?. It should only be:

 on_change=onchange_partner_id(partner_id)

Hope this helps you!

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: 3/28/13, 11:29 AM
Seen: 4137 times
Last updated: 3/16/15, 8:10 AM