type= fields.Selection([('a', '吃'), ('b', '喝')], string='类型')
We all know that self.type outputs "a" or "b", but in many cases we need to get "eat" or "drink", such as outputting the value of type in Report. What should we do at this time?
type= dict(self.fields_get(allfields=['type'])['type']['selection'])[self.type]
The self inside can be judged according to whether it is the current model.
This line of code can be easily implemented, and it can be used in both py and xml