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 ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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 ?
Workaround: button in tree view with following function in model (assuming a1 and a2 are one2many fields):
@api.multi
def go_view(self):
self.ensure_one()
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,
}
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
Sep 23
|
3584 | ||
|
2
Jul 23
|
1643 | ||
|
2
Jun 22
|
2750 | ||
|
0
Sep 21
|
1254 | ||
|
0
Sep 20
|
1731 |