i have this selection field
Fam = fields.Selection(selection=[('x1','x1'),('x2','x2')])
i want to get the selected value of Fam selection field and write the condition if no item is selected in Fam
i tried this code
@api.onchange('Fam')
def _onchange_Fam(self):
#here i want to write condition of if No item is selected in Fam selection field
if(self.Fam == ''):
#code
else:
#print the selected value
print (dict(self._fields['Fam'].selection).get(self.Fam))
But i get this error :
ValueError: dictionary update sequence element #0 has length 1; 2 is required
i want to know how to print selected field and how to check if there is a selected item in the selection field
thanks.