'validates that `status` is acceptable for the present controller status
and throws an Exception if otherwise.'

def status_can_change(self, status):

    if (self.status and (self.status == u'Cancelled')):
        if (status != self.status):
            frappe.throw(_(u'{0}    {1}    is    cancelled    so    the    action    cannot    be    completed').format(_(self.doctype), self.name), frappe.InvalidStatusError)
    elif (self.status and (self.status == u'Draft')):
        if (status != u'Pending'):
            frappe.throw(_(u'{0}    {1}    has    not    been    submitted    so    the    action    cannot    be    completed').format(_(self.doctype), self.name), frappe.InvalidStatusError)
