This question has been flagged

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

Avatar
Discard

Thank you very much 🙏🏼