Sanjay Gohel (Open ERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-905279-sgo into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #905279 in OpenERP Addons: "problem while saving doc file in document"
  https://bugs.launchpad.net/openobject-addons/+bug/905279

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-905279-sgo/+merge/86204

Hello sir,

    I have put error message for doc type file. that installed anti word for 
read word file(doc file).
kindly review it.

Thanks.

sgo
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-905279-sgo/+merge/86204
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-905279-sgo.
=== modified file 'document/std_index.py'
--- document/std_index.py	2011-11-22 08:51:38 +0000
+++ document/std_index.py	2011-12-19 09:44:29 +0000
@@ -95,9 +95,15 @@
         return ['.doc']
 
     def _doIndexFile(self,fname):
-        pop = Popen(['antiword', fname], shell=False, stdout=PIPE)
-        (data, _) = pop.communicate()
-        return _to_unicode(data)
+        try:
+            pop = Popen(['antiword', fname], shell=False, stdout=PIPE)
+            (data, _) = pop.communicate()
+            return _to_unicode(data)
+        except:
+            import netsvc
+            logger = netsvc.Logger()
+            logger.notifyChannel("document", netsvc.LOG_ERROR, 'Please install Antiword package(MS Word reader): sudo apt-get install antiword')
+            return False
     
 cntIndex.register(DocIndex())
 

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to