콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

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?

아바타
취소
베스트 답변

maybe you have the same problem like i had:

https://accounts.openerp.com/forum/Help-1/question/8598/

look my answer, maybe that is the solution for you too.

아바타
취소
작성자

Hi there, thanks for your response but unfortunately it looks like the fix either hasn't been released or doesn't work as I am still experiencing the issue despite updating my server and web code. Thanks for pointing me in the right direction though.

관련 게시물 답글 화면 활동
0
3월 15
3684
3
2월 25
35578
2
2월 25
8686
1
9월 24
2317
3
7월 24
24725