تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
6262 أدوات العرض

Hello, I have a module that use a .exe application to generate some csv.

To call it I use subprocess, like this:

from subprocess import * 

def test(self, cr, uid, ids, context={}):

subproc = Popen([C:\gen.exe], stdout=PIPE, stderr=PIPE)
(out, err) = subproc.communicate()

return True

And it's working.

Now I'm trying to do the same thing with .bat files, but I can't make it work.

This code works in python:

import subprocess 
subprocess.Popen('C:\test.bat')

but once loaded in a module function, the bat file it's not executed.

Is there a way to execute batchs from odoo?

Any help is appreciated


EDIT:

The problem was the command "@echo off" in bat file at the start of the program.

Removing it, odoo can execute the file.



الصورة الرمزية
إهمال
أفضل إجابة

you could find an answer here

http://stackoverflow.com/a/1818902 

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مارس 15
13072
1
مايو 16
5218
1
مارس 15
7224
1
فبراير 17
3987
1
مارس 15
8907