Heat a small pan over med high heat and add the oil. Add the onions and shallot and toss to coat with the oil. Reduce the heat to low and allow the onions and shallots to sweat and caramelize . Add the tomatoes, brown sugar, vinegar and tomato paste. Stir to combine and cook until the mixture is thick and bubbly. Add the stock and reduce to thick bubbly consistency again. Season with salt and pepper. Remove from heat and set half the mixture aside. Puree the other half and fold it back into reserved mixture. Fold in the basil