diff --git a/base_report_to_printer/printing.py b/base_report_to_printer/printing.py index 1e59684..9207a49 100755 --- a/base_report_to_printer/printing.py +++ b/base_report_to_printer/printing.py @@ -118,10 +118,9 @@ class printing_printer(osv.osv): raise finally: cr.close() - self.lock.acquire() - self.updating = False - self.last_update = time.time() - self.lock.release() + with self.lock: + self.updating = False + self.last_update = time.time() def start_printer_update(self, cr, uid, context):