It depends on the restaurant, the location, and the type of shorts. Running shorts, etc.. are unacceptable but "dress" shorts are acceptable in resort areas and at informal dining establishments. In larger cities (esp. Milan) and finer restaurants, slacks would be in order.