Need to import a class in customapp


I have a customapp installed in my site i have the below function for creating a new document from Opportunity. I have written the code in separate py file and added it to but its not running, i need to import the class Opportunity, i have given as below,

from erpnext.crm.doctype.opportunity import Opportunity

Class CreateSourcingRequest(Opportunity):
def on_submit(self):

def make_sourcing_request(self):
    parent = frappe.get_all("Opportunity")
    child = frappe.get_all("Opportunity Item")

    for row in self.items:
        doc = frappe.new_doc("Sourcing Request")
            "opportunity"   			:,
            "customer_name" 			: self.customer_name,
            "opportunity_starting_date" : self.opportunity_starting_date,
            "opportunity_closing_date"	: self.opportunity_closing_date,
            "probability"				: self.probability,
            "contact_person"			: self.contact_person,
            "item_code"     			: row.item_code,
            "qty"						: row.qty,
            "uom"						: row.uom,
            "internal_sourcing_notes"	: row.internal_sourcing_notes,
            "ndb_mfr_pn"				: row.ndb_mfr_pn,
            "ndb_mfr"					: row.ndb_mfr,
            "ndb_uom"					: row.uom,
            "ndb_description"			: row.ndb_description
    frappe.msgprint("Sourcing Request created")

Thanks in advance!