So guys, I creating a small tool that will help our wharehouse user.
I am near to the end of my quest, but stuck on how to take ‘Booked’ items and Create a `Purchase Receipt’
So far I only can create Batch value… but I am stack this Purchase Receipt
that has a Child Table Items.
def save(self):
# For booked Items make a Purchase Receipt
purchase_order = frappe.get_doc('Purchase Order', self.purchase_order)
for item in self.booked:
new_batch = frappe.get_doc({
"doctype": "Batch",
"batch_id": item.batch,
"item": item.item_code,
"quantity": item.quantity,
"description": """
For Purchase Order: {0}
Created: {1}
Quantity: {2}
""".format(self.purchase_order, frappe.utils.today(),
item.quantity)
})
new_batch.insert()
print("Save it")