def METHOD_NAME(self):
    """
    Delete an invoice having related documents.
    Check that the related documents are no more deleted
    if linked to a sale order.
    """
    order_line, sale_order = self._create_order()
    invoice = sale_order._create_invoices()
    self.assertEqual(len(invoice), 1, "Multiple invoices for sale order")
    related_documents = invoice.related_documents
    # Delete the invoice: the related document persists
    invoice.unlink()
    self.assertTrue(related_documents.exists())
    # Delete the sale order: the related document is deleted too
    sale_order.action_cancel()
    sale_order.unlink()
    self.assertFalse(related_documents.exists())