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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kirjanpito
- Varastointi
- PoS
- Projekti
- MRP
Tämä kysymys on merkitty
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
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
Nautitko keskustelusta? Älä vain lue, vaan osallistu!
Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!
Rekisteröidy| Aiheeseen liittyviä artikkeleita | Vastaukset | Näkymät | Toimenpide | |
|---|---|---|---|---|
|
|
1
jouluk. 22
|
4354 | ||
|
What is wizard ?
Ratkaistu
|
|
3
marrask. 23
|
34714 | |
|
|
4
heinäk. 25
|
5725 | ||
|
|
2
jouluk. 23
|
18801 | ||
|
populate wizard form dynamically
Ratkaistu
|
|
6
huhtik. 18
|
22532 |