I want to create timer in odoo view which support run/pause (using button ) something like Soccer match time , min:sec format
I tried below code but it generated an error
api.one
def timer_th(self):
timer_thread = Thread(target=self.timer) timer_thread.start()
def timer(self):
while self.current_time <= self.duration:
time.sleep(1) self.current_time += 1
it gave me AttributeError: environments error
but when I used the code without thread it works but gui wasn't responsive