Aaron Harnett thought he could get away with having a puff while away from his workplace drug testing.

A Manawatu meatworks employee's plan to avoid random drug tests while on holiday did not factor in one crucial element - being caught by police.

Aaron James Harnett, 43, pleaded guilty in the Palmerston North District Court on Thursday to possessing cannabis - a charge the court heard he had faced many times.

He was in a car that was pulled over by police on State Highway 1, as part of a routine traffic stop, at 8.40am on January 1.

Police found 13 grams of cannabis, in the form of 18 tinnies, in the car, which Harnett said were his.

Defence lawyer Simon Parsons said Harnett worked as a skinner at the Ovation meatworks in Feilding, where he was subjected to random drug tests.

He had been there one year and always been clean, and was going on holiday when he was caught, Parsons said.

"He was off to a party.

"He thought he could have a puff."

Harnett had a long history, but had been out of court for the past three years, Parsons said.

Judge Jim Large said the lack of recent convictions showed there had been a lifestyle change.

"But 18 tinnies and 13 grams is a bit more than one smoke."

He fined Harnett $450 - the maximum fine was $500 - and left him with a warning.

"If you get caught again for cannabis, you will be looking at a loss of liberty."

The maximum prison term for possession of cannabis is three months.