'Blank C-form no if C-form applicable marked as \'No\''

def validate_c_form(self):

    if (self.amended_from and (self.c_form_applicable == u'No') and self.c_form_no):
        frappe.db.sql(u'delete    from    `tabC-Form    Invoice    Detail`    where    invoice_no    =    %s\n DCTB  DCTB  DCTB  DCTB  DCTB and    parent    =    %s', (self.amended_from, self.c_form_no))
        frappe.db.set(self, u'c_form_no', u'')
