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.


Tree view main model, form view delegated models

on 7/31/15, 5:39 AM 353 views

Hi !

I have tree objects A, A1 and A2.

A1 & A2 inherits A by delegation.

Is it possible to make a tree view of A in a way that when a user clicks on a row, it opens a form view of corresponding delegated objects A1 / A2 ?

On 7/31/15, 9:27 AM

Workaround: button in tree view with following function in model (assuming a1 and a2 are one2many fields):

def go_view(self):
record = self.a1 if self.a1 else self.a2 if self.a2 else False
return {
'type': 'ir.actions.act_window',
'res_model': record._name,
'view_mode': 'form',
'view_id': self.env.ref('test.view_' + record._name + '_form').id,
'res_id': record.id,

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

1 follower(s)


Asked: 7/31/15, 5:39 AM
Seen: 353 times
Last updated: 7/31/15, 9:29 AM