7

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 Answers1

16

I think you should try something like this at respective line:

super(product_product, self.with_context(ctx)).create(vals)
Vipul Bhatt
  • 372
  • 4
  • 10