0 votes

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.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 (10.5k points) | 50 views

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
205 questions
180 answers
221,381 users