A Spanish court ruled that an electrical company was wrong to fire one of its electricians for allegedly drinking more than three liters of beer on the job because it couldn’t prove he was drunk.

Drinking alcohol during work hours is usually frowned upon and can constitute grounds for dismissal, but according to a high court in Murcia, Spain, that is only true when the employer can prove without a shadow of a doubt that the accused was inebriated to the point where he could no longer fulfill his duty safely.

The court recently ordered an electrical company to either reinstate the sacked worker or pay them 47,000 euros ($52,000) for failing to show that their drinking on the job left them inebriated, intoxicated or drunk”, or unable to do their job.

The controversial ruling also mentioned that the company failed to consider the hot Murcian summer, which apparently justified beer consumption.