Electrostatic potential is a critical factor to evaluate the severity of electrostatic hazard during filling oil tanks. A novel model is proposed for calculating electrostatic potential in tanks during filling process. In the model, the nonuniform electrostatic charge distribution is solved by considering the diffusion, convection, conduction, and dissipation forces acting on the electrostatic charge. Additionally, an experiment was carried out for measuring electrostatic potential, and the maximum surface potential from the experiment coincided with that of calculation well. By applying the model, the distribution of electrostatic potential is explored, and the influences of relaxation time and some other factors on the electrostatic potential are analyzed. The results show that the peak value of the maximum surface potential calculated by the proposed model occurs much later in the filling than the existed model with the assumption of uniform electrostatic charge distribution. The relaxation time is a key factor to influence the electrostatic potential, and it also affects the filling fraction at which surface potential reaches the peak value. The maximum surface potential increases with the increase of the diffusion coefficient of the ion, the dynamic viscosity of the oil and the filling rate, respectively.