Odoo Help

0

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

By
Mohamed
on 11/17/16, 6:04 AM 1,501 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 Babu @ iWesabe

--Shameem Babu @ iWesabe--
GLOBAL CREATIVE CONCEPTS TECH CO LTD
http://www.iwesabe.com
1282
| 6 3 7
KHOBAR, Saudi Arabia
--Shameem Babu @ iWesabe--

  

 iWesabe - ODOO ERP IMPLEMENTATION & CUSTOMIZATION SAUDI ARABIA.



For Queries :  shameem@iwesabe.com

Activities     :    Youtube

                           Stackoverflow 

Experience

           iWesabe                                  ◉

           Axon Communications        ❍

           Cybrosys Technologies        ❍


Shameem Babu @ 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
0
law rence
On 5/23/18, 3:10 AM

What is your parent_obj? please tell me thanks. I need this. Please elaborate, explain it to me thanks


dear law actually in python context is a key value pair, so in that case

'context': {'parent_obj': self.id}

'key':self.id

'parent_obj' is a key and self.id is value

hope this helps you

Sehrish
on 5/24/18, 6:31 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: 1501 times
Last updated: 5/23/18, 3:10 AM