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

[Solved] Incomprehensible maximum recursion depth

By
Ludovic CHEVALIER
on 6/29/15, 7:16 AM 663 views

Hi!

I try to overload a method in point_of_sale module in a custom module.

class pos_order(osv.osv):
_inherit = 'pos.order'

def onchange_partner_id(self, cr, uid, ids, part=False, context=None):
if not part:
return {value: {}}
res = super(pos_order, self).onchange_partner_id(cr, uid, ids, part=part, context=context)
        return res

 With this code, I have this error:

RuntimeError: maximum recursion depth exceeded while calling a Python object


Why?

OK. I'd declared my inherited class twice in my custom module. If I overload the onchange_partner_id method in first, it doesn't work. If I overload it in the second one, it's ok.

L'Heureux-Cyclage, Ludovic CHEVALIER
on 6/29/15, 11:26 AM
0
Clément TheSecond
On 6/29/15, 8:42 AM

What you can try to do is : changing the name of your class from :

pos_order to something like my_pos_order

So that when you call your super method

res = super(pos_order, self).onchange_partner_id(cr, uid, ids, part=part, context=context)  

it's not ambigous

0
Ludovic CHEVALIER
On 6/29/15, 9:36 AM

Hi Artemis!

Thanks for the answer. But I think @api.model usage is not available in 7.0 version, isn't it?

I tried and it seems no. :-(


Ok, so, you're using the version 7.0 of Odoo ... well I don't really know what you can do then ...

Clément TheSecond
on 6/29/15, 10:56 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

1 follower(s)

Stats

Asked: 6/29/15, 7:16 AM
Seen: 663 times
Last updated: 6/29/15, 11:27 AM