Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


opportunities in lead field one2many 6.1

on 4/26/13, 8:42 AM 1,177 views


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?

Tech Receptives
On 4/26/13, 9:07 AM

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

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'}"
on 4/26/13, 10:30 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


Asked: 4/26/13, 8:42 AM
Seen: 1177 times
Last updated: 3/16/15, 8:10 AM