Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


create timer (count down/ count up) on form view

on 11/21/16, 4:03 AM 145 views

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

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 11/21/16, 4:03 AM
Seen: 145 times
Last updated: 11/21/16, 4:03 AM