
    Argued November 6,
    affirmed December 21, 1972
    DEAN VINCENT, INC. Appellant, v. CHAMBERLAIN et ux, Respondents.
    
    504 P2d 722
    
      
      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, J.

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 stitti 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 Pule 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 ivith 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.

In Rogue River Management Co. v. Shaw, 243 Or 54, 63, 411 P2d 440 (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 “[defendants 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 P2d 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, 262 Or 247, 250, 497 P2d 1183, 1189 (1972). In a recent case, Fulton Ins. Co. v. White Motor Corp., 261 Or 206, 493 P2d 138 (1972), this court refused to reverse a case involving defective pleadings first objected to on appeal. We stated, at 219, 493 P2d 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. * * *”

Prom 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-87, 362 P2d 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 Co. State Bank v. Nichols, 153 Or 73, 78, 54 P2d 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.

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 ease 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, 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, 262 Or 317, 319-21, 497 P2d 1166 (1972). In Joseph v. Lowery, 261 Or 545, 550, 495 P2d 273 (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. 
      
       Plaintiff cites McGilchrist v. Fiedler, 155 Or 616, 65 P2d 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 P2d 364 (1961); Benton Co. State Bank v. Nichols, 153 Or 73, 54 P2d 1166 (1936) (counterclaim for fraud permitted in an action on contract).
     
      
       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.”
     