Al final lo he solucionado tocando el codigo del report.py
Por lo visto en Debian a veces da error al ejecucion de unoconv si la
salida es el stdout. Es un "parche" para salir del paso mientras analizo
mas a fondo el problema
#cmd = ['/usr/local/bin/unoconv', '--connection=\'%s\'' %
config.get('report', 'unoconv'),
# '-f', oext, '--stdout', path]
##PARCHE PARA IMPRIMIR PDF FALLA EN EL STDOUT
import re
outputpath = re.sub('.odt', '.%s' % (oext), path)
if os.path.exists(outputpath):
os.unlink(outputpath)
cmd = "/usr/local/bin/unoconv --connection='%s' -f %s %s >
/dev/null 2>&1" % (config.get('report', 'unoconv'),oext, path)
try:
import commands
status, output = commands.getstatusoutput(cmd)
if os.path.exists(outputpath):
with open(outputpath, 'r') as content_file:
stdoutdata = content_file.read()
else:
raise "ERROR"
return stdoutdata
finally:
os.remove(path)
os.remove(outputpath)
El jueves, 9 de abril de 2015, 8:51:37 (UTC+1), Antonio Roncero escribió:
>
> Entonces, ¿como deberia hacerlo? pensaba que unoconv convertia desde odt a
> pdf.
>
> Gracias
>
> El jueves, 9 de abril de 2015, 8:44:31 (UTC+1), raimonesteve escribió:
>>
>> 2015-04-08 20:33 GMT+02:00 Antonio Roncero <[email protected]>:
>> > Hola de nuevo,
>> >
>> > estoy intentando generar pdf directamente para algunos informes, para
>> ello
>> > he ido a acciones-> informes y he seleccionado en Extension: Portable
>> > Document Format.
>>
>> Si el informe es ODT, no deberias usar la extención PDF
>>
>> > Cuando le doy para generar el informe me sale el siguiente error:
>> >
>> > Traceback (most recent call last):
>> > File "/trytond/protocols/jsonrpc.py", line 150, in
>> _marshaled_dispatch
>> > response['result'] = dispatch_method(method, params)
>> > File "/trytond/protocols/jsonrpc.py", line 179, in _dispatch
>> > res = dispatch(*args)
>> > File "/trytond/protocols/dispatcher.py", line 161, in dispatch
>> > result = rpc.result(meth(*c_args, **c_kwargs))
>> > File "/trytond/report/report.py", line 144, in execute
>> > type, data = cls.parse(action_report, records, data, {})
>> > File "/trytond/modules/company/company.py", line 365, in parse
>> > localcontext)
>> > File "/trytond/report/report.py", line 301, in parse
>> > data = cls.unoconv(data, report.template_extension, output_format)
>> > File "/trytond/report/report.py", line 322, in unoconv
>> > raise Exception(stderrdata)
>> > Exception: None
>> >
>> > En el servidor parece que es un error de unoconv
>> >
>> > ['unoconv',
>> > '--connection=pipe,name=trytond;urp;StarOffice.ComponentContext', '-f',
>> > u'pdf', '--stdout', u'/tmp/trytond_ab42uV.odt']
>> > unoconv: UnoException during export phase:
>> > Unable to store document to private:stream (ErrCode 3088)
>> >
>> >
>> > En /tmp los permisos son correctos y en la carpeta definida en el
>> parametro
>> > path del archivo de configuración también.
>> >
>> > unoconv (0.6) y libreoffice (4.3.3.2) están instalados en el servidor.
>> >
>> > Gracias
>> >
>>
>>
>>
>> --
>> Si us plau, NO adjunti arxius a les seves respostes. Li preguem que
>> integri el text al cos del missatge. Pot respondre usant NetEtiquete
>> que li ajudarà a seguir la conversa.
>> http://es.wikipedia.org/wiki/Netiquette
>>
>> Por favor, NO adjunte archivos a sus respuestas. Le rogamos que
>> integre el texto en el cuerpo del mensaje. Puede responder usando
>> NetEtiquete que le ayudará a seguir la
>> conversación.http://es.wikipedia.org/wiki/Netiquette
>>
>> Please, DO NOT send attachment files with your answers, just copy and
>> paste only the text you need to send into the body of your mails.
>> Repply using NetEtiquete. http://en.wikipedia.org/wiki/Netiquette
>>
>