On 2016-10-06 17:55, Khurram Shahzad wrote: > Dear Community, > > As per the requirements of our users, we decided to create "sale" when and > appointment is saved for a patient. I am able to "create" the "sale" row > from "create" method of appointment (actually gnuhealth_appointment). > > Now, I want to relate the "gnuhealth.appointment" row with "sale.sale" row > bu storing id of appointment in the "origin" column of "sale.sale". How can > I get the "id" of appointment in the create method, as, I think, id is > assigned after the row is saved which is done by the last line of create > method: > > super(Appointment,cls).create(appointments); > > Can any body guide me how I can achieve this?
You need to use the returned value of create which is a list of instances where the attribute 'id' is filled. -- Cédric Krier - B2CK SPRL Email/Jabber: [email protected] Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ -- 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/20161007081902.GA99626%40tetsuo.
