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

Using with_context in super call turns into infinite call in odoo

By
Emipro Technologies Pvt. Ltd.
on 7/2/15, 3:37 AM 1,255 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})

self.with_context(ctx).methodname()


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.

1
Anabela Damas
On 2/15/16, 7:30 AM

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

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: 7/2/15, 3:37 AM
Seen: 1255 times
Last updated: 2/15/16, 7:30 AM