Generally, the entity should be entitled to a deduction as soon as it meets the all-events test (the fact of the liability is fixed and the amount is determinable).
Section 461(h) and § 1.461-1(a)(2)(i) provide that, under the accrual method of accounting, a liability is incurred, and is generally taken into account for federal income tax purposes, in the taxable year in which (1) all the events have occurred that establish the fact of the liability, (2) the amount of the liability can be determined with reasonable accuracy, and (3) economic performance has occurred with respect to the liability.
I hope this is the information that you need. Please let me know if you need clarification.
Section 461(h)(2)(A)(i) provides that, if the liability of the taxpayer arises out of the providing of services to the taxpayer by another person, economic performance occurs as that person provides the services. Generally, in a transaction where one taxpayer is accruing a liability to pay another taxpayer, the last event necessary to establish the fact of liability under the all events test of § 1.461-1(a)(2)(i) is the same event that fixes the right to receive income under the all events test of § 1.451-1(a).
In the case of a lawsuit there usually are no services to be performed and economic performance need not be considered.
I hope that helps to clarify the general rules.