Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
10291 มุมมอง

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

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

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!

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Your function must be:

res = super(project_project, self).onchange_partner_id(self, cr, uid, ids, part, context):
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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!

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ต.ค. 24
636
0
มิ.ย. 24
822
1
มิ.ย. 24
4208
1
ต.ค. 23
1209
"Wrong value for %s: %r" % (self, value) แก้ไขแล้ว
2
ต.ค. 23
1565