Odoo Help

0

How to update the context on the new api ?

By
Jean-Baptiste Bernard
on 4/14/16, 9:11 AM 2,950 views

hello I try to add new values in the context with the new api but after many try we did'nt sucess.

What we have try :

self.with_context(get_sizes=True)
print self.env.context
self.with_context({'get_sizes': True, 'free_ref': free_ref}) 
self.with_context().create(get_sizes=True)
3
Zbik
On 4/14/16, 11:36 AM

Try this:

 self = self.with_context(get_sizes=True)
print self.env.context

or

self.with_context(get_sizes=True).create()

This works ! self = self.with_context(get_sizes=True) Thank you very much !

Aldébarande, Jean-Baptiste Bernard
on 4/15/16, 3:05 AM

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.

Register

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)

Stats

Asked: 4/14/16, 9:11 AM
Seen: 2950 times
Last updated: 4/15/16, 3:05 AM