In Reporting date - passing date to search in list-view I learned hot to use context_model
to filer what is show in a list-view.
Now I try to use the context_model
in a window domain, like this:
This view shall show several “window domain”, where some depend on the date (date within or outside some period of the record) while others don’t depend on the date (here: depend on the state).
My non-working code:
<record model="ir.action.act_window" id="act_members_form">
<field name="name">Show current Members</field>
<field name="res_model">association.member</field>
<field name="context_model">association.member.context</field>
</record>
<record model="ir.action.act_window.domain" id="act_members_list_current">
<field name="name">Current</field>
<field name="sequence" eval="30" />
<field name="domain"
eval="[('join_date' ,'!=', None),
('join_date', '<=', Eval('date', Date())),
['OR', ('leave_date', '=', None),
('leave_date', '>=', Eval('date', Date()))]]"
pyson="1" />
<field name="count" eval="True" />
<field name="act_window" ref="act_members_form" />
</record>
In the “window domain”, date
is undefined, which will make the Eval(('date', Date())
return today’s date. (I tried different expressions, this is why I know date
is undefined.)
How can I use the date
value from the context_domain
in the “window domain”?