I am attempting to use the UnionMixin available in 3.4 to make a model that 
is just a collection of records from other models. All the other ModelSQLs 
have a few common fields and these fields are defined on the model that 
uses the UnionMixin. Based on my understanding, that's how the UnionMixin 
determines which field to select from each of the models' tables used in 
the union. 

My questions are about the recommended way to do things as it relates to 
this Mixin.

   1. Should I inherit from ModelSQL *and* UnionMixin? - I think yes 
   because it's ModelSQL's methods that are overridden to make UnionMixin work
   2. If the answer to #1 is yes, should I register the model in the Pool? 
   When I do, it creates a table for the UnionMixin model. Is this expected?
   3. Looking at the code, I see that I can unshard the union-ised ID to 
   get the index of the original model. Is this the recommended way for me to 
   identify the original model?
   4. Is there a way to rewire the [New Record] button to give the user a 
   chance to choose which model, within the union, to create or which form to 
   use? If not, I think I may be able to use a wizard
   5. Further to #4, is there a way to rewire the double-click in the tree 
   view so it opens the appropriate form for the model of row clicked? 

And finally, am I on the right track or did I misunderstand the purpose of 
the UnionMixin?

Thanks. 

---
MM

Reply via email to