Odoo Help


Using with_context in super call turns into infinite call in odoo

Emipro Technologies Pvt. Ltd..
on 7/2/15, 3:37 AM 3,715 views

In odoo context dictionary is frozen so no one can update it, for that one solution is also available is calling method using with_context.

ctx = self.env.context.copy()

ctx.update({'additional_parameter' : value})


but when we use the same pattern to call super method then result turns into the infinite call.

ctx = self.env.context.copy()

ctx.update({'additional_parameter' : value})

super(product_product, self).with_context(ctx).create(vals)

Any help will be highly appreciated.


Anabela Damas

--Anabela Damas--

| 6 7 7
Aveiro, Portugal
--Anabela Damas--
IT Consultant
Anabela Damas
On 2/15/16, 7:30 AM

super(product_product, self.with_context(ctx)).create(vals)

Wolfgang Pichler
On 5/12/17, 11:25 AM


i've had the same problem on odoo9 (and i assume it will be the same in odoo 10+). Simple solution for this - add an other parameter 'i_was_already_here': True to the context - in the same function do check for this paramter at the start - if it does exists - then the context already got updated - and you can call the super call without the context update. So you wont get the infinite loop

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: 7/2/15, 3:37 AM
Seen: 3715 times
Last updated: 4/17/18, 7:25 AM