Hi, anyone can help me resolve this problem? Here is my code:
data['form'] = self.read(cr,uid,ids,['alphalist_category_type','a_alpha_type','fiscalyear_id'])
year1 = data['form']['fiscalyear_id']
date_code = re.split('-',contract.date_start)
year2 = int(date_code[0])
if data['form']['a_alpha_type'] == 'prev' and year2 < int(year1):
and upon running i get this error message:
"year1 = data['form']['fiscalyear_id']
TypeError: list indices must be integers, not str"
i tried to cast fiscalyear_id as int, but i get this error message:
"year1 = data['form'][int('fiscalyear_id')]
ValueError: invalid literal for int() with base 10: 'fiscalyear_id' "
Help, please!