This question has been flagged
1 Reply
3981 Views

Hi,

In crm.lead i go with somethink like this:

_inhrerit = 'crm.lead'
_columns = {
'parent_id': fields.many2one('crm.lead', 'Parent', ondelete='cascade'),
'opportunity_ids': fields.one2many('crm.lead','parent_id','Opportunities', domain=[('type','=','opportunity')]),
}

in Leads Form View i have added

<field name="opportunity_ids" />

It works but i need view from opportunity, not lead. I see this field in my view but it shows me like 'lead tree view' and after click 'create' button i see 'lead form view' - not opportunity. How to change it to opportunity tree/form view?

Avatar
Discard
Best Answer

in context just pass {'default_tree_view': <xml id of required tree view>, 'default_form_view:<xml id of required form view>}

Avatar
Discard
Author

Code: > {'default_tree_view': <xml id of required tree view>, 'default_form_view:<xml id of required form view>}

doesnt work. After couple of hours I've found solution here: http://doc.openerp.com/v6.0/developer/2_6_views_events/views/specify_view_to_use.html

context="{'form_view_ref' : 'module.view_id', 'tree_view_ref' : 'model.view_id'}"