#NEWLINE# @ transition ( field = 'state' , source = BillingDocument . STATES . ISSUED , target = BillingDocument . STATES . CANCELED ) #NEWLINE# def cancel( self , cancel_date = None , affect_related_document = True ) : #NEWLINE# #INDENT# super ( Invoice , self ) . cancel ( cancel_date ) #NEWLINE# if ( self . proforma and self ) : #NEWLINE# #INDENT# self . proforma . cancel ( cancel_date = cancel_date , affect_related_document = False ) #NEWLINE# self . proforma . save ( )