Romantic / comedy movie in high school, the main guy after break up stopped believing in love but then he fell for a girl

The whole movie is on some high school, the main actor was once in love with a love of his life, but the broke up. After this, he was just looking for “one night girls” and never wanted to fall in love again. Also he had 2 friends, with whose he had part-time job, where they were selling pools.

One of his friends was fat and actually ugly, but he was trying to get a girl.

The main guy fell again for a new girl and but she didnt want to have sex from the start, she wanted to wait for the “moment” or something, BUT then there showed up the bad guy THAT stole his ex girlfriend and lied to him, how the new girl loves him and not our guy. So he was sad and ALMOST had sex with his ex, but in the end he didnt.

Things got somehow right and it ended up well.

Can you tell me the name pleeeeeas?

when did you see it? was it a sex comedy?

I think last time I´ve seen it was 2018 probably?

And it wasnt sex comedy