section 606(4)


606(4) Notwithstanding any other provision of this Act, where an accused or defendant pleads not guilty of the offence charged but guilty of any other offence arising out of the same transaction, whether or not it is an included offence, the court may, with the consent of the prosecutor, accept that plea of guilty and, if the plea is accepted, the court shall find the accused or defendant not guilty of the offence charged and find him guilty of the offence in respect of which the plea of guilty was accepted and enter those findings in the record of the court.