Hi there,
I have a child table that contains (Items), and now I want to count unique items in the child table
In the following picture,
I use the following code to create sales orders,
docu = frappe.new_doc('Sales Order')
docu.customer = 'Osama'
docu.order_type = "Sales"
for x in doc.medication_orders:
docu.append("items", {
'item_code' : x.drug,
'delivery_date': doc.start_date,
'qty': 1,
'uom': doc.dosage_form
})
docu.insert()
this code creates a Sales Order with the same Child table in Inpatient Medication Order,
the final result should be like this
Name Qty
Omega 2
Alarmin 2