Hello,
I need to change my slection elements after change field1 .
this code doesn't work , who has an idea how to fix it ?
_columns = {
'field1': fields.selection([('1', 'A'), ('1', 'B')], 'my filed 1'),
'field2': fields.selection([('aa', 'C'), ('bb', 'D')], 'my filed 2'),
}
def onchange_field2(self, cr, uid, ids,field1,context=None):
    lst= [('5', '5'), ('6', '6'), ('7', '7'), ('8', '8')]
    try:
        lst.remove([item for item in lst if item[0] == '5'][0])
    except IndexError as e:
        pass
    v = {'field2': lst}
    return {'value': v}
thank you
 
                        
thanks