Skip to Content
Menu
This question has been flagged
6 Replies
6856 Views

Saving .doc en .txt works ok in knowledge management. But when I try to save a document with the extension PDF results in an error. This is the case with any PDF file. I do not understand the traceback and how to solve this problem.

Traceback: OpenERP OpenERP Server Error Client Traceback (most recent call last): File "/var/packages/OpenERP7.x/target/openerp/addons/web/http.py", line 195, in dispatch response["result"] = method(self, *self.params) File "/var/packages/OpenERP7.x/target/openerp/addons/web/controllers/main.py", line 1079, in call_kw return self._call_kw(req, model, method, args, kwargs) File "/var/packages/OpenERP7.x/target/openerp/addons/web/controllers/main.py", line 1071, in _call_kw return getattr(req.session.model(model), method)(args, **kwargs) File "/var/packages/OpenERP7.x/target/openerp/addons/web/session.py", line 43, in proxy result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw) File "/var/packages/OpenERP7.x/target/openerp/addons/web/session.py", line 31, in proxy_method result = self.session.send(self.service_name, method, *args) File "/var/packages/OpenERP7.x/target/openerp/addons/web/session.py", line 104, in send raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

Server Traceback (most recent call last): File "/var/packages/OpenERP7.x/target/openerp/addons/web/session.py", line 90, in send return openerp.netsvc.dispatch_rpc(service_name, method, args) File "/usr/local/lib/python2.7/site-packages/openerp/netsvc.py", line 295, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/usr/local/lib/python2.7/site-packages/openerp/service/web_services.py", line 614, in dispatch res = fn(db, uid, params) File "/usr/local/lib/python2.7/site-packages/openerp/osv/osv.py", line 188, in execute_kw return self.execute(db, uid, obj, method, *args, *kw or {}) File "/usr/local/lib/python2.7/site-packages/openerp/osv/osv.py", line 131, in wrapper return f(self, dbname, args, *kwargs) File "/usr/local/lib/python2.7/site-packages/openerp/osv/osv.py", line 198, in execute res = self.execute_cr(cr, uid, obj, method, args, *kw) File "/usr/local/lib/python2.7/site-packages/openerp/osv/osv.py", line 185, in execute_cr return getattr(object, method)(cr, uid, args, *kw) File "/var/packages/OpenERP7.x/target/openerp/addons/document/document.py", line 121, in create vals['file_type'], vals['index_content'] = self._index(cr, uid, vals['datas'].decode('base64'), vals.get('datas_fname', False), None) File "/var/packages/OpenERP7.x/target/openerp/addons/document/document.py", line 132, in _index mime, icont = cntIndex.doIndex(data, datas_fname, file_type or None, None) TypeError: 'NoneType' object is not iterable

Avatar
Discard

Same problem here with Project documents

Best Answer

SYNOLOGY RELATED ISSUE: Since there is no method available (at least not without very deep hacking) to install the necessary poppler-utils on a Synology box, I just disabled the indexing fully using a hack I found on the launchpad buglist:

1) modify the file /var/packages/OpenERP7.x/target/openerp/addons/document/document.py

ORIGINAL CODE:

def create(self, cr, uid, vals, context=None):
    if context is None:
        context = {}
    vals['parent_id'] = context.get('parent_id', False) or vals.get('parent_id', False)
    # take partner from uid
    if vals.get('res_id', False) and vals.get('res_model', False) and not vals.get('partner_id', False):
        vals['partner_id'] = self.__get_partner_id(cr, uid, vals['res_model'], vals['res_id'], context)
    if vals.get('datas', False):
        vals['file_type'], vals['index_content'] = self._index(cr, uid, vals['datas'].decode('base64'), vals.get('datas_fname', False), None)
    return super(document_file, self).create(cr, uid, vals, context)

def _index(self, cr, uid, data, datas_fname, file_type):
    mime, icont = cntIndex.doIndex(data, datas_fname,  file_type or None, None)
    icont_u = ustr(icont)
    return mime, icont_u

MODIFIED CODE

def create(self, cr, uid, vals, context=None):
    if context is None:
        context = {}
    vals['parent_id'] = context.get('parent_id', False) or vals.get('parent_id', False)
    # take partner from uid
    if vals.get('res_id', False) and vals.get('res_model', False) and not vals.get('partner_id', False):
        vals['partner_id'] = self.__get_partner_id(cr, uid, vals['res_model'], vals['res_id'], context)
#    if vals.get('datas', False):
#        vals['file_type'], vals['index_content'] = self._index(cr, uid, vals['datas'].decode('base64'), vals.get('datas_fname', False), None)
    return super(document_file, self).create(cr, uid, vals, context)

def _index(self, cr, uid, data, datas_fname, file_type):
#    mime, icont = cntIndex.doIndex(data, datas_fname,  file_type or None, None)
#    icont_u = ustr(icont)
#    return mime, icont_u
        return False

2) restart OpenERP

Now the attachment upload should work for PDFs also.

WARNING 1: Absolutely no guarantee that this does not break something else!

WARNING 2: Make backups of the data and the code before you try this!

WARNING 3: This will disable indexing for ALL uploaded/attached documents!

Avatar
Discard
Best Answer

Die Lösung für den Poppler-Utils Bug.

Was man benötigt

• 7z Zip-Programm (Google fragen)

• Putty (Google fragen)

• Kompilierte Version der Poppler-Utils (https://packages.debian.org/de/sid/poppler-utils)

Vorgehen

• Runterladen der korrekten Poppler-Utils. Dies ist abhängig von der CPU-Architektur. Für den Atom habe ich die AMD64 Version verwendet.

• Entpacken der Files bis nur doch die Verzeichnisstruktur – beginnend mit „usr“ - übrig ist. Hat man das nicht bereits auf der Disk Station gemacht, dann muss an die Verzeichnisse nun auf die DS verschieben.

• Mit der Putty einloggen. Als User verwendet man „root“ und das Passwort des Administrators.

• Nun sucht man mit dem Befehl „dir ..“ und „dir <Verzeichnis>“ die Poppler-Utils-Verzeichnisse.

• Nun kopiert man die Poppler-Utils-Verzeichnisse mit den Dateien wie folgt in das /usr Verzeichnis:

cp -r usr /

• Prüfen ob die Dateien in die richtigen Verzeichnisse kopiert wurden.

• Viel Spaß beim Upload von PDF-Dateien im OpenERP

Solution for the Poppler-Utils bug.

What you need

• 7z zip (ask google where to download)

• Putty (ask google where to download)

• Compiled file of poppler-utils (https://packages.debian.org/de/sid/poppler-utils)

Proceeding

• Download the correct archive of the poppler-utils depending on the CPU architectur in your Disk Station. For Atom use the AMD64 version. That worked fine for me.

• Unpack the files until you have the folder structure starting with "usr". If you haven't done that on the DS, move the folder “bin” and “share” with the files somewhere on the DS next.

• Login with the putty: Use "root" as user name and use your admin pass word.

• Move with "cd .." and "cd <folder name>" to the folder where you stored the poppler-utils-files.

• Copy the files to the root/usr folder like follows:

cp -r usr /

• Check if the files are correct in the folders.

• Enjoy uploading PDF files with OpenERP.

Avatar
Discard
Best Answer

Zum Installieren von IPKG siehe die SYNOLOGY Wiki: http://www.synology-wiki.de/index.php/IPKG

Avatar
Discard
Best Answer

Same probleme here with project documents:

OpenERP Server Error

Client Traceback (most recent call last): File "/var/packages/OpenERP7.x/target/openerp/addons/web/http.py", line 195, in dispatch response["result"] = method(self, *self.params) File "/var/packages/OpenERP7.x/target/openerp/addons/web/controllers/main.py", line 1079, in call_kw return self._call_kw(req, model, method, args, kwargs) File "/var/packages/OpenERP7.x/target/openerp/addons/web/controllers/main.py", line 1071, in _call_kw return getattr(req.session.model(model), method)(args, **kwargs) File "/var/packages/OpenERP7.x/target/openerp/addons/web/session.py", line 43, in proxy result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw) File "/var/packages/OpenERP7.x/target/openerp/addons/web/session.py", line 31, in proxy_method result = self.session.send(self.service_name, method, *args) File "/var/packages/OpenERP7.x/target/openerp/addons/web/session.py", line 104, in send raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

Server Traceback (most recent call last): File "/var/packages/OpenERP7.x/target/openerp/addons/web/session.py", line 90, in send return openerp.netsvc.dispatch_rpc(service_name, method, args) File "/usr/local/lib/python2.7/site-packages/openerp/netsvc.py", line 295, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/usr/local/lib/python2.7/site-packages/openerp/service/web_services.py", line 614, in dispatch res = fn(db, uid, params) File "/usr/local/lib/python2.7/site-packages/openerp/osv/osv.py", line 188, in execute_kw return self.execute(db, uid, obj, method, *args, *kw or {}) File "/usr/local/lib/python2.7/site-packages/openerp/osv/osv.py", line 131, in wrapper return f(self, dbname, args, *kwargs) File "/usr/local/lib/python2.7/site-packages/openerp/osv/osv.py", line 198, in execute res = self.execute_cr(cr, uid, obj, method, args, *kw) File "/usr/local/lib/python2.7/site-packages/openerp/osv/osv.py", line 185, in execute_cr return getattr(object, method)(cr, uid, args, *kw) File "/var/packages/OpenERP7.x/target/openerp/addons/document/document.py", line 121, in create vals['file_type'], vals['index_content'] = self._index(cr, uid, vals['datas'].decode('base64'), vals.get('datas_fname', False), None) File "/var/packages/OpenERP7.x/target/openerp/addons/document/document.py", line 132, in _index mime, icont = cntIndex.doIndex(data, datas_fname, file_type or None, None) TypeError: 'NoneType' object is not iterable

The installation is running on a synology server, document management is installed. Any hint? Thank you!

Avatar
Discard

SYNOLOGY RELATET ISSUE: OK i figured out poppler-utils are missing and needed to be installed. For this IPKG needs to be installed first, but I am still searching the poppler-utils file neccessary...

Related Posts Replies Views Activity
2
Jul 24
675
1
Apr 19
3662
1
Jul 16
5272
1
Mar 15
3497
0
Mar 16
2501