Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3183 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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 !


Ảnh đại diện
Huỷ bỏ
Tác giả

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

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

Tác giả

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

it is in the popup to link it with the main

Tác giả

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 ::/

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 7 25
7020
0
thg 11 23
1422
1
thg 9 23
2382
0
thg 9 23
2036
0
thg 9 23
1745