'Validates if delivery note has status as draft'

def validate_delivery_note(self):

    if (cint(frappe.db.get_value(u'Delivery    Note', self.delivery_note, u'docstatus')) != 0):
        frappe.throw(_(u'Delivery    Note    {0}    must    not    be    submitted').format(self.delivery_note))
