i have following selection fields in my module i want to get string value of selection field. suppose user select 'o' i want to print O - Original please provide me any better solution.
type = fields.Selection([
('o', 'O - Original'),
('a', 'A - Amended')],
string="Is this an Original Invoice or Amended Invoice ?"
i have this solution
def get_string_value_of_selection():
if self.type == 'o':
value = "O - Original",
if self.type == 'a':
value = "A - Amended"
print "value = ",value
output
if user select o
value = O - Original
Hope this will helps: https://learnopenerp.blogspot.com/2021/08/get-selection-field-value-instead-of-key-odoo.html