Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
12615 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Auteur

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.

Auteur

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

Publications associées Réponses Vues Activité
1
oct. 21
5505
3
mars 15
10127
1
mars 15
3864
1
mars 15
5284
1
mars 15
10407