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

How to update the context on the new api ?

By
Jean-Baptiste Bernard
on 4/14/16, 9:11 AM 1,535 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)
1

zbik

--zbik--
5976
| 6 4 7
Lodz, Poland
--zbik--


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

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: 4/14/16, 9:11 AM
Seen: 1535 times
Last updated: 4/15/16, 3:05 AM