Odoo Help

0

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

By
Mohamed
on 11/17/16, 6:04 AM 443 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

1

Shameem iWesabe

--Shameem iWesabe--
773
| 5 3 5
Calicut, India
--Shameem iWesabe--

Activities     :    Youtube

                           Stackoverflow 

Experience

           iWesabe                                  ◉

           Axon Communications        ❍

           Cybrosys Technologies        ❍


Shameem iWesabe
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


You save my life :p

Khidma, Zied Haffoudhi
on 5/16/17, 6:59 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: 11/17/16, 6:04 AM
Seen: 443 times
Last updated: 11/17/16, 10:59 PM