Hi @manal_erpnext:
doc.make_gl_entries() calls a class method that you can find on many doctypes controller . Basically, all the doctypes that generates data on general ledger.
doc.make_gl_entries()
Here, function receives doc argument, a document instance from some doctype.
doc
Hope this helps.
acutally this method get_accounting_ledger_preview just preview not make real gl entry but why its call the make_gl_entries