def re_validate_invoice(obj_invoice):
 if obj_invoice.is_valid:
  return HttpResponseBadRequest(_('This invoice is already active.'))
 obj_invoice.is_valid = True
 obj_invoice.save()
 message = _('The registration codes for invoice {0} have been re-activated.').format(obj_invoice.id)
 return JsonResponse({'message': message})

def re_validate_invoice ( obj_invoice ) : if obj_invoice . is_valid : return HttpResponseBadRequest ( _ ( 'This invoice is already active.' ) ) obj_invoice . is_valid = True obj_invoice . save ( ) message = _ ( 'The registration codes for invoice {0} have been re-activated.' ) . format ( obj_invoice . id ) return JsonResponse ( { 'message' : message } )
this method re-validate the sale against the invoice number .