
504 P.2d 722 (1972)
DEAN VINCENT, INC., a Corporation, Appellant,
v.
Glenn A. CHAMBERLAIN and Emily Chamberlain, Husband and Wife, Respondents.
Supreme Court of Oregon, In Banc.
Argued and Submitted November 6, 1972.
Decided December 21, 1972.
*723 Max A. Ingerson, Eugene, argued the cause and filed a brief for appellant.
Marvin E. Hansen, Eugene, argued the cause for respondents. With him on the brief were Hansen, Curtis, Hendershott & Strickland, Eugene.
BRYSON, Justice.
Plaintiff, an Oregon corporation, brought this action to recover a real estate broker's commission. Defendants' supplemental answer and cross complaint contained three affirmative defenses, failure of consideration, lack of a binding contract, and fraud, and a counterclaim that alleged breach of a fiduciary duty by plaintiff and damages to the defendants. The plaintiff demurred to the defendants' first affirmative defense (failure of consideration) and to the second affirmative defense (lack of a binding contract). The court entered an order allowing the demurrer to the second affirmative defense but denied the same as to the first affirmative defense. Defendants then filed a second amended answer and cross complaint which contained three affirmative defenses: failure of consideration, fraudulent representations, and estoppel. In all other respects, the second amended answer and cross complaint was substantially the same as defendants' supplemental answer and cross complaint. Plaintiff then filed a reply admitting "that the relationship between the Plaintiff and Defendants was a fiduciary one" but denied all other allegations in defendants' second amended answer and cross complaint. Prior to trial, defendants successfully moved to amend their second amended answer and cross complaint to provide "* * * for Defendants' reasonable attorney's fees herein in the sum of $1500.00." At the beginning of the trial the parties stipulated that the court would set reasonable attorney fees based on the record and files of the case and on testimony of work done by attorneys. The court instructed the jury:
"In regard to the stipulation of counsel regarding attorney's fees, I advise you that this is a matter of no concern to the jury, and is a matter solely for the Court's consideration."
The jury returned a verdict for defendants in the sum of $2,500; the court allowed defendants attorney fees of $1,200 and entered judgment in favor of defendants in the sum of $3,700. The plaintiffs appeal.
The facts of the case are not germane to the issues raised on appeal. Plaintiff, in the preparation of its brief, has disregarded Rule 2.45 of this court which provides, in part:
"The argument shall follow each assignment or combination of assignments of error or proposition in the order stated."
Plaintiff's four assignments of error are set forth consecutively, followed by one argument with citations. We have reluctantly attempted to segregate the citations and portions of the argument which apply to each assignment of error.
The plaintiff's first assignment of error is that "[t]he court erred in overruling plaintiff's demurrer to defendants' first further separate answer and affirmative defense contained in defendants' supplemental answer and cross complaint."
After the plaintiff's demurrer to defendants' first further separate answer and affirmative defense had been ruled on, the defendants filed their second amended answer and cross complaint. The plaintiff did not attack the sufficiency of defendants' second pleading by motion or demurrer. This is the pleading on which the case went to trial. When defendants filed their new answer, the former answer was, in effect, withdrawn, and all motions and demurrers relating to it accompanied it.
*724 In Rogue River Management Co. v. Shaw, 243 Or. 54, 63, 411 P.2d 440, 444 (1966), we stated:
"* * * that upon the filing of an amended pleading, the original pleadings and all motions and demurrers relating thereto cease to be a part of the record. [Citations omitted.]"
This has been the law in Oregon since Wells v. Applegate, 12 Or. 208, 6 P. 770 (1885). Thus, the court's ruling on the former pleading is not a part of the record on which an assignment of error can be based.
Plaintiff next contends that "[d]efendants have failed to set forth facts in any of their second, third, and fourth further answers and affirmative defenses sufficient to constitute a defense."
As stated, the plaintiff did not challenge the legal sufficiency of defendants' pleadings before the trial court.
In Politte v. Vanderzee, 256 Or. 461, 463, 473 P.2d 1013, 1014 (1970), this court stated:
"* * * It is axiomatic that a pleading first challenged here is construed favorably to the pleader. If the pleading can be construed as stating a cause of action or a defense, it will be upheld. * * *"
See also, Owings v. Rose, 94 Or.Adv.Sh. 1718, 1728, 497 P.2d 1183, 1189 (1972). In a recent case, Fulton Ins. Co. v. White Motor Corp., 94 Or.Adv.Sh. 213, 493 P.2d 138 (1972), this court refused to reverse a case involving defective pleadings first objected to on appeal. We stated, at 223, 493 P.2d at 145:
"* * * [W]here the defect in a pleading, even though material, consists of a mere omission to state a necessary fact, and it appears that the omitted fact could have been added by amendment, the entire record will be examined when the pleading is attacked for the first time on appeal. If we can determine that the omission did not result in surprise or prejudice, or prevent a full trial of the real issues between the parties, and that the evidence disclosed the existence of a cause of action, we will not reverse, but will treat the case as though the question had been raised at the proper time and the pleadings amended accordingly. * * *"
From an examination of the complete record before us, we believe that the shortcomings in defendants' pleading now raised by plaintiff did not surprise or prejudice plaintiff in presenting its case and plaintiff's reply admitted "the fiduciary relationship between the parties."
Plaintiff's next contention, that the trial court improperly permitted defendants to counterclaim for breach of fiduciary duty, is without merit. In Mack Trucks, Inc. v. Taylor, 227 Or. 376, 386-387, 362 P.2d 364, 369 (1961), this court stated that the purpose of the counterclaim in modern practice is to "permit the expeditious and economical disposition of various claims between the litigants in a single suit unless the issues are so unrelated that the consolidation of them would unduly complicate the trial." Counterclaims are permitted where the cause of action arises out of the "contract or transaction" which provides the foundation of the plaintiff's complaint. ORS 16.300(1)(a). In this connection, we have construed the word "transaction" broadly to include "all that takes place in the conducting of any item of business or an affair." Benton Cty. State Bank v. Nichols, 153 Or. 73, 78, 54 P.2d 1166, 1168 (1936).
The breaches of fiduciary duty alleged by defendants arise out of and are closely related to the transaction on which plaintiff's action is founded and were properly consolidated and tried together.[1]
*725 Plaintiff lastly assigns as error the order of the trial court permitting defendants to amend their second amended answer and cross complaint to provide for reasonable attorney fees. The earnest money agreement signed by defendants on August 2, 1969, states:
"* * * In case suit or court action is instituted to collect said sum [the broker's commission] or any part thereof I further agree to pay, in addition to the costs and disbursements provided by statute, such additional sum as the Court may adjudge as reasonable attorney's fees to be allowed in said suit or action."
Plaintiff contends that ORS 20.096,[2] which became effective September 9, 1971, should not be retroactively applied in defendants' favor to an action on the contract quoted above.
ORS 20.096 is patterned after California Civil Code Section 1717. The statute's legislative history is discussed in McMillan v. Golden, 95 Or.Adv.Sh. 23, 25, 497 P.2d 1166 (1972). In Joseph v. Lowery, 94 Or. Adv.Sh. 951, 955, 495 P.2d 273, 276 (1972), we held:
"* * * The interpretation another state places upon its statute at the time our legislature incorporates that act into Oregon law is highly persuasive in the absence of a legislative directive that our statute is not to be similarly construed. * * *"
In Malibou Lake Mountain Club, Ltd. v. Smith, 18 Cal. App.3d 31, 35, 95 Cal. Rptr. 553, 556 (1971), the court stated in a footnote, which is apparently dicta, that the California statute did not apply to a contract executed prior to the effective date of the statute. In Coast Bank v. Holmes, 19 Cal. App.3d 581, 97 Cal. Rptr. 30 (1971), the court, after an extensive discussion, held that the California statute did apply to contracts in existence before the effective date of the statute. In each of these cases the California Supreme Court denied a hearing.
We are persuaded by the reasoning of the court in Coast Bank and believe that retroactive application of ORS 20.096 is consistent with the legislative intent.
The court did not err in allowing attorney fees in favor of the defendants.
Affirmed.
NOTES
[1]  Plaintiff cites McGilchrist v. Fiedler, 155 Or. 616, 65 P.2d 388 (1937), for the proposition that in an action on contract, a counterclaim in the nature of a tort cannot be pleaded. This rule, announced in McGilchrist as an alternative basis for the result in the case, is inconsistent with our current view of ORS 16.300. The propriety of a counterclaim should be judged not according to the form of the action, but rather according to whether the issues raised by the parties' claims are so unrelated that their consolidation would unduly complicate or delay the trial. See Mack Trucks, Inc. v. Taylor, 227 Or. 376, 362 P.2d 364 (1961); Benton Cty. State Bank v. Nichols, 153 Or. 73, 54 P.2d 1166 (1936) (counterclaim for fraud permitted in an action on contract).
[2]  ORS 20.096 states:

"Attorney fees and costs in proceedings to enforce contract. (1) In any action or suit on a contract, where such contract specifically provides that attorney fees and costs incurred to enforce the provisions of the contract shall be awarded to one of the parties, the prevailing party, whether he is the party specified in the contract or not, at trial or on appeal, shall be entitled to reasonable attorney fees in addition to costs and necessary disbursements.
"(2) Attorney fees provided for in a contract described in subsection (1) of this section shall not be subject to waiver by the parties to any such contract which is entered into after September 9, 1971. Any provision in such a contract which provides for a waiver of attorney fees is void.
"(3) As used in this section `prevailing party' means the party in whose favor final judgment or decree is rendered.
"(4) As used in this section `contract' includes any instrument or document evidencing a debt."
