El 23/12/2012 12:48 p.m., Cédric Krier escribió:
On 23/12/12 12:02 -0500, Odicha wrote:
Hi.
trytond can not open unoconv in a .
In a linux box works fine. Command in report.py is:
cmd = ['unoconv', '--connection=%s' % CONFIG['unoconv'],
'-f', oext, '--stdout', path]
This code doesn't run on a windows box, because it needs python exe
& path. (you must run unoconv with libreoffice python exe)
It might be something like this:
cmd = ['c:/archivos de programa/libreoffice
3.6/program/python.exe', 'c:/archivos de programa/libreoffice
3.6/program/unoconv', '--connection=%s' % CONFIG['unoconv'],
'-f', oext, '--stdout', path]
I think the best approach for this is add some extra config value,
something like LIBREOFFICE_PATH so it could be parsed if trytond is
running on a win32 box. I'll open an issue, but I'd like to know
what do you think before writing a patch.
I could be something like:
if sys.platform == "win32":
cmd= ['%s' % CONFIG['libreoffice_path.......
For me, it is windows who sucks and we should not hack Tryton for that.
A simple solution is to put a "unoconv" executable in the current
directory.
Sure it sucks. But if you don't want "to freeze" it and work with it as
a framework, make unoconv executable is not perhaps the best answer.
A possible patch could be this:
if os.name == 'nt':
cmd = ['%spython.exe' % CONFIG ['libreoffice_path'],
'%sunoconv' % CONFIG ['libreoffice_path'], '--connection=%s' %
CONFIG['unoconv'],
'-f', oext, '--stdout', path]
else:
cmd = ['unoconv', '--connection=%s' % CONFIG['unoconv'],
'-f', oext, '--stdout', path]
And adding line to config.py and .conf file
I think it's better making some small hacks & running tryton + gnuhealth
in windows than porting gnu health code to openerp because you can not
run a linux server instead a win32 one. (it's only an example)
--
--
[email protected] mailing list