Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
9107 Visualizzazioni

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
Abbandona

Thank you very much 🙏🏼

Post correlati Risposte Visualizzazioni Attività
1
nov 24
4757
3
nov 24
45175
0
gen 21
4569
3
apr 17
24158
0
mar 23
2033