Odoo Help

Welcome!

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.

0

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

By
Mohamed
on 11/21/16, 4:03 AM 135 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

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

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)

Stats

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