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

I have tried this to update the context from the controller:

context = http.request.env.context.copy()
context.update({'profile_id': profile.id})
http.request.env.context = context

By doing this, the context gets updated, but how can I get this context in act_window?

<record id="profile_specific_appointments_action" model="ir.actions.act_window">         
    <field name="name">Appointments</field>         
    <field name="res_model">oe.appointment</field>         
    <field name="view_type">tree</field>         
    <field name="view_mode">calendar,tree</field>         
    <field name="domain">[('profile', '=', context.get('profile_id)]</field>         
</record>

 

This code did not work, it could not find 'profile_id' in context.


UPDATE: I figured out a way to solve this problem.

You can find the solution from here:

 https://medium.com/@rameshwordhakal/pass-context-from-the-controller-to-act-window-47eb75a6f566

Ảnh đại diện
Huỷ bỏ

Thank you very much 🙏🏼

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 11 24
4783
3
thg 11 24
45237
0
thg 1 21
4594
3
thg 4 17
24222
0
thg 3 23
2058