Odoo Help


odoo9: How to return data from popup to main?

Vale Trood
on 4/19/16, 4:41 AM 577 views

Hello everybody!!!

Can anyone help me to know how can i catch the values that i have created in a popup to the main page.

Thanks a lot in advance.

Best Regards.

On 4/19/16, 4:49 AM

Here is how i did it :

  1. have a one2many or many2one relation between the main model and the model you have in your wizard (popup)

  2. use the value of active_id in context when creating the wizard model to make the relationship between the 2 records:
    Let's say you have a field main_id in your wizard model. You need to do something like this :

    main_id = fields.Many2one('main.model', default=context.get('active_id'))

  3. enjoy !

hey friend i didnt understand the second step :/ Would you please give me an example.

Vale Trood
on 4/19/16, 5:00 AM

I Edited my answer. Hope it's clear now.

on 4/19/16, 5:28 AM

sorry but is the main_id a field in the popup or the main page??

Vale Trood
on 4/19/16, 5:39 AM

it is in the popup to link it with the main

on 4/19/16, 6:12 AM

sorry but the popup is the hr.contract model and in the main is the hr.employee model and in the contract model there is a many2one field of the second model ::/

Vale Trood
on 4/19/16, 6:39 AM

it should not be an issue you can set the value in the create method of the contract

on 4/19/16, 6:47 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.


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)


Asked: 4/19/16, 4:41 AM
Seen: 577 times
Last updated: 4/19/16, 4:49 AM