Hi folks,
So, I have an entity in my system called "Calendar Events". This entity has a field called "case_id" defined as follows:
'case_id': fields.many2one('jcrm.case','Linked Case'),
From my case entity, I have a button on the form view that takes the user from cases to events and tries to filter the events by the case_id.
Search view definition for case_id on event search screen (verified working when manually typing in a case):
<field name="case_id" filter_domain="[('case_id','ilike',self)]" />
Definition of the actions attached to my button:
<record id="action_case_calendar_event_list" model="ir.actions.act_window">
<field name="name">Case Events</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">jcrm.calendar.event</field>
<field name="src_model">jcrm.case</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_case_id': active_id}</field>
<field name="domain">[]</field>
<field name="search_view_id" ref="jcrm_calendar.view_jcrm_calendar_event_search"/>
</record>
It is the context which is "broken" here. In version 6, the 'search_default_case_id': active_id, would basically automatically fill in the case_id search field with the ID of the case I am coming from. In version 7, this doesn't work.
I wondered if the problem was the "active_id" bit so I hard coded an ID, that didn't work.
I wondered if the terminology didn't work anymore, so I tried a different field type ('search_default_name': 'Alex') and that did work, so it seems my terminology is correct.
So, I was wondering if anyone could help me out?