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

In Odoo v8, I have extended crm.lead model to add some fields. Also created specific menu and views to show them differently than through original Lead/opportunities menus and views.

I have other model "A", and they have a m2o/o2m relationship, so I can go back and forth.

But, whenever I click on model "A" m2o field "crm_lead_id", the default lead view is opened, but I need to open my customized view (to see extra fields).

How do I specify it for model "A" m2o field "crm_lead_id"?

아바타
취소
베스트 답변

In that many2one field 'crm_lead_id' try to pass the 'context' as below:

<field name="crm_lead_id"
context="{'search_view_ref':'<<your search view name along with the modulename - modulename.viewname>>',
        'tree_view_ref':'<<your tree view name along with the modulename - modulename.viewname>>'
'form_view_ref':'<<your form view name along with the modulename - modulename.viewname>>'}"/>

Hope this helps !!.

아바타
취소
작성자

It is not working so far. I am trying to type the refs with and without module (which is current module), with and without character '.

Is it giving any error? Can you post your changes view? Try to find the example that I suggested. I am sure this will help you. This thing works fine at our side.

작성자

It fails without error. I see no errors in logs (with DEBUG level), but it just ignores the context. So when I click on 'lead_id' it opens the original crm.lead form, instead the one I specified. I have double-checked the ids of views, but no luck. So, I see nothing weird... but context is ignored, it seems. Module name: The python field definition: crm_ticket_platforms lead_id = fields.Many2one( 'crm.lead', string='Lead', select=True, ondelete='restrict' ) And the XML where I put the field: Any idea?

@Anubia, im facing the same problem here

관련 게시물 답글 화면 활동
1
10월 21
5581
3
3월 15
10253
1
3월 15
3950
1
3월 15
5358
1
3월 15
10530