I have a doctype name Library Dashboard. it is single page doctype and in this doctype i want to set the value of this doctype particular filed. In order to achieve the same i have implemented the below code, I do have all parameter except docname and i am stuck here and i am not able to figured out the docname. I have tried to explore docs but it was not helpful for me the only thing
i want to know how do i get this docname parameter?
from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document from frappe.utils import date_diff, nowdate, formatdate, add_days class LIbraryDashboard(Document): def totalBooks(): totalBookCopy = 0 bookNumberCopies = frappe.get_list("Book List", fields = ["no_book_copy", "book_name"], limit_page_length = 50000) bookNumberCopiesList = list(map(lambda keyValue:keyValue["no_book_copy"] , bookNumberCopies)) totalBookNumber = sum(bookNumberCopiesList) print(totalBookNumber) frappe.db.set_value("LIbrary Dashboard", doc.name, 'total_no_books', totalBookCopy);