On 2017-01-22 12:26, Khurram Shahzad wrote:
> Dear all,
> 
> At our hospital, doctors prescribe medication for admitted patients which
> is stored as:
> 
> patient-id, medicine-name
> 
> This is stored in a model patient-medication.
> 
> Our nursing department wants to have a form for 'Ordering medicine', when
> the open this form they want an already populated list containing:
> 
> patient-id, medicine-name, qty_to_order
> 
> These lines should be populated using the patient-medication table and
> 'qty_to_order' field is provided to user for entering how much quantity is
> to be ordered. They should also be able to add/remove rows from the list.
> 
> For this, I have written following code:
> 
>  medications = fields.One2Many('gnuhealth.inpatient.medication',
> 'name','Medications',[('admission_no.state','=','hospitalized')])
> 
>  But, I am unable to add 'qty_to_order' field and make it editable

With such design, you have to extend the model
'gnuhealth.inpatient.medication' to add the field qty_to_order. I do not
know if it makes sense at all.

-- 
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/20170122100804.GO68908%40tetsuo.

Reply via email to