Research on fish cognition provides strong evidence that fish are endowed with high level cognitive skills. However, most studies on cognitive flexibility and generalization abilities, two key adaptive traits for captive animals, focused on model species, and farmed fish received too little attention. Environmental enrichment was shown to improve learning abilities in various fish species, but its influence on cognitive flexibility and generalization abilities is still unknown. We studied farmed rainbow trout (Oncorhynchus mykiss) as an aquaculture model to study how environmental enrichment impacts their cognitive abilities. Using an operant conditioning device, allowing the expression of a motivated choice, we measured fish cognitive flexibility with serial reversal learning tests, after a successful acquisition phase based on two colors discrimination (2-alternative forced choice, 2-AFC), and their ability to generalize a rewarded color to any shape. Eight fish were divided into two groups: Condition E (fish reared from fry stages under enriched conditions with plants, rocks and pipes for ~9 months); Condition B (standard barren conditions). Only one fish (condition E) failed in the habituation phase of the device and one fish (condition B) failed in the 2-AFC task. We showed that after a successful acquisition phase in which the fish correctly discriminated two colors, they all succeeded in four reversal learnings, supporting evidence for cognitive flexibility in rainbow trout. They were all successful in the generalization task. Interestingly, fish reared in an enriched environment performed better in the acquisition phase and in the reversal learning (as evidenced by fewer trials needed to reach the learning criterion), but not in the generalization task. We assume that color-based generalization may be a simpler cognitive process than discriminative learning and cognitive flexibility, and does not seem to be influenced by environmental conditions. Given the small number of individuals tested, our results may be considered as first insights into cognitive flexibility in farmed fish using an operant conditioning device, but they pave the way for future studies. We conclude that farming conditions should take into account the cognitive abilities of fish, in particular their cognitive flexibility, by allowing them to live in an enriched environment.