In this study, the poly-12-hydroxy stearic acid (PTHSA) was synthesized and then modified by esterification with pentaerythritol to obtain a polyol polymeric hyperdispersant (polyol-PTHSA). Under suitable reaction conditions (molar ratio pentaerythritol/PTHSA, 1.2:1; reaction temperature, 453 K; and reaction time, 4−8 h), the polyol-PTHSA with acid value of 3 mg of KOH/g can be obtained. The structures were confirmed by FT-IR analysis. The polyol-PTHSA was subsequently used as a hyperdispersant in the process of preparing environmentally friendly overbased calcium oleate detergent to increase the total base number of the product. Reaction conditions including the polymerization catalyst, the catalyst amount, the amount of xylene, the polymerization temperature, the polymerization time, the polyol-PTHSA amount, and the acid value of the PTHSA were optimized.