I have a tree/list view and I want to customize what form is opened when clicking on a record in the list. The record's each have a related record and each one may be from a different model. I know I can find and return the corresponding views dynamically through python but I am unsure of how to link this to the xml.
I have record 1 which has the fields res_model=mrp.production and res_id=500.
I have record 2 which has the fields res_model=stock.picking and res_id=125.
Both record 1 and 2 appear in my list view but I would like it to open the default form of their respective res_model when I click on them in the list view.