Could it have been The Navy Lark (1959)?
That sounds like the sort of thing they'd get up to.
That was a film version of the popular radio show of the same name. But it didn't work as well, partly because the pictures are better on the radio and partly because they didn't use the full crew from the radio version. In fact Leslie Phillips was about the only one from the radio show who was in the film.
Steve