From 0397468a05569c330aa575ddb80263e45c2f92e2 Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Fri, 12 Nov 2010 15:44:16 +0530 Subject: [PATCH] [IMP]: Improve search view of Task hours report of project_timesheet module and file descriptor close() in document module. bzr revid: atp@tinyerp.co.in-20101112101416-51opsl6u147argqm --- addons/document/std_index.py | 16 +++++++++-- .../project_timesheet/report/task_report_view.xml | 29 ++++++++++++++------ 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/addons/document/std_index.py b/addons/document/std_index.py index 2a588a0..7cfcd36 100644 --- a/addons/document/std_index.py +++ b/addons/document/std_index.py @@ -96,8 +96,13 @@ class DocIndex(indexer): def _doIndexFile(self,fname): fp = Popen(['antiword', fname], shell=False, stdout=PIPE).stdout - return _to_unicode(fp.read()) - + try: + file_data = _to_unicode(fp.read()) + finally: + fp.close() + + return file_data + cntIndex.register(DocIndex()) class DocxIndex(indexer): @@ -158,7 +163,12 @@ class PdfIndex(indexer): def _doIndexFile(self,fname): fp = Popen(['pdftotext', '-enc', 'UTF-8', '-nopgbrk', fname, '-'], shell=False, stdout=PIPE).stdout - return _to_unicode( fp.read()) + try: + file_data = _to_unicode( fp.read()) + finally: + fp.close() + + return file_data cntIndex.register(PdfIndex()) diff --git a/addons/project_timesheet/report/task_report_view.xml b/addons/project_timesheet/report/task_report_view.xml index 87949d6..8a6c3c0 100644 --- a/addons/project_timesheet/report/task_report_view.xml +++ b/addons/project_timesheet/report/task_report_view.xml @@ -31,17 +31,29 @@ - - + + + - + - - - - + + + + + + @@ -64,8 +76,7 @@ report.timesheet.task.user form tree,graph - {"search_default_user_id":uid} - + {'search_default_month':1, 'search_default_group_user_id':1} -- 1.7.10.4