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

[SOLVED] How to pass current values to wizard in odoo?

By
Mohamed
on 11/17/16, 6:04 AM 174 views

I have some wizard opens when I click a button, this wizard insert some values in child model of the main model so I need to send some data from main model to the wizard
data includes current id

0
shameem@aχoncoms
On 11/17/16, 6:56 AM

Mohamed,

Use context for this

Example

return {
    'type': 'ir.actions.act_window',
    'name': 'Name ',
    'view_mode': 'form',
    'target': 'new',
    'res_model': 'Your.Model',
'context': {'parent_obj': self.id}
}

Inside the function of wizard object

@api.one    
def your_function(self):
     print self._context['parent_obj']

Thanks


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: 11/17/16, 6:04 AM
Seen: 174 times
Last updated: 11/17/16, 10:59 PM