On Friday, 15 September 2017 20:25:07 UTC+3, Cédric Krier wrote: > On 2017-09-14 14:24, Roei Erez wrote: > > In our application we have Patient model, which has a lot in common with > > Party model. > > We would like to add a tree view for patient and add a menu item. > > We would also like to create a dedicated form for adding/editing Patients. > > It seems like there are two ways to achieve that but we have problems in > > either ways: > > > > 1. Patient inherit from Party - we are able to enhance the party model with > > the Patient fields but we didn't find a way to customize the form for > > Patient that will show the added Patient fields and only some of the fields > > (the relevant ones) from Party model. > > Just create a new view and use it for the action that opens only the > patient. > You can also update the Many2One widgets of other Model with the > attribute view_ids to use this new view. > This option could be a lot of work if you have many view to customize. > > And other option is to make good usage of the 'states' to make extend > the standard view and show "patient" fields only when it is a patient. > > > 2. Patient contains Party - This enables us to customize the Patient form > > but then the creation of a new Patient requires two steps: create a party > > and then add the Patient specific fields which make user experience less > > optimal. > > This is a good option too. It is what we have choosen for many cases: > product-template, carrier-party, bank-party, employee-party, > company-party etc. > > In the case of patient, I guess you will have to add a unique constraint > to ensure a party has only one patient. > > -- > Cédric Krier - B2CK SPRL > Email/Jabber: [email protected] > Tel: +32 472 54 46 59 > Website: http://www.b2ck.com/
Thanks a lot! I am glad option 1 is possible. Regarding "using the new view for the action that opens only the patient" one quick question: I have an entry in the menu that opens tree view of patients. How do I make the "new" action at that view to open the patient form? -- You received this message because you are subscribed to the Google Groups "tryton" group. To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/cd702747-a5d3-4c04-9273-fc66e54b3175%40googlegroups.com.
