i am trying to pass opportunity id in to opportunity lookup in orde bt getting this error. can anyone plz help me.
error-Error: Compile Error: Illegal assignment from Id to Opportunity at line 9 column 16
public class order_Creation
{
public static void osCreated(List<Opportunity> op)
{
List <Order> orderToInsert = new List <Order>();
for(Opportunity o : op){
if(o.StageName == 'Closed Won' && o.RecordTypeId == '01228000000EyCa'){
Order v = new Order();
v.Opportunity = o.id;
v.Account = o.Account;
v.EffectiveDate = System.today();
v.ContractId = o.Contract_Number__c;
v.Status = 'Draft';
orderToInsert.add(v);
}
}
insert orderToInsert;
}
}