0 votes
4 views

I have an auto-parts products with attributes as: car, model and year say the item is suitable for a car model from 2010 to 2014. I don't need to write all years in the field I just need to write the highest and lowest year and fetch all years in between.this is my code

@api.multi
@api.depends('start', 'end')
def years(self):
    range = [int(x) for x in range('start', 'end')]
    return range

start = fields.Integer(string="", required=False, )
end = fields.Integer(string="", required=False, )
range = fields.Integer(compute=years )

but i get error UnboundLocalError: local variable 'range' referenced before assignment

in Back-end by (10k points) | 4 views

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
173 questions
146 answers
30 comments
10,931 users