ERROR: Import “frappe.model.document” could not be resolvedPylancereportMissingImportsImport “frappe.model.document” could not be resolvedPylancereportMissingImports
THE CODE: from future import unicode_literals
import frappe
from frappe.model.document import Document
class LibraryMembership(Document):
def before_submit(self):
exists = frappe.db.exists(
‘Library Membership’,
{
‘library_member’: self.library_member,
‘docstatus’: 1,
‘to_date’: (‘>’, self.from_date),
},
)
if exists:
frappe.throw(‘There is an active membership for this member’)