Skip to Content
Menu
This question has been flagged
1 Reply
12505 Views

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"?

Avatar
Discard
Best Answer

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 !!.

Avatar
Discard
Author

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.

Author

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

Related Posts Replies Views Activity
1
Oct 21
5429
3
Mar 15
9939
1
Mar 15
3786
1
Mar 15
5191
1
Mar 15
10303