You should have received a copy of the GNU Lesser General Public License
along with idempierewsc.  If not, see <http://www.gnu.org/licenses/>.
"""

import traceback

from idempierewsc.base import LoginRequest
from idempierewsc.enums import WebServiceResponseStatus
from idempierewsc.net import WebServiceConnection
from idempierewsc.request import QueryDataRequest
from sandbox import IDEMPIERE_URL

login = LoginRequest()
login.client_id = 11
login.org_id = 0
login.role_id = 102
login.password = '******'
login.user = '******'

query = QueryDataRequest()
query.web_service_type = 'QueryBPartnerTest'
query.offset = 2
query.limit = 5
query.login = login

wsc = WebServiceConnection()
wsc.url = IDEMPIERE_URL
wsc.attempts = 3
wsc.app_name = 'Test from python'
from idempierewsc.base import Operation
from idempierewsc.base import Field
from idempierewsc.request import CreateDataRequest
from idempierewsc.request import CompositeOperationRequest
from idempierewsc.enums import WebServiceResponseStatus
from idempierewsc.net import WebServiceConnection
import traceback
import random

url = 'http://localhost:8031'
urls = 'https://localhost:8431'

# CREATE LOGIN
login = LoginRequest()
login.client_id = 11
login.org_id = 0
login.role_id = 102
login.password = '******'
login.user = '******'

# CREATE WEBSERVICE FOR IMAGE
path_image = '../../documents/idempiere-logo.png'

ws1 = CreateDataRequest()
ws1.web_service_type = 'CreateImageTest'
ws1.data_row.append(Field('Name', path_image))
ws1.data_row.append(Field('Description', 'Test Create BPartner and Logo'))

# CREATE BINARY FIELD
binary_field = Field('BinaryData')
binary_field.set_byte_value(open(path_image, 'rb').read())
Ejemplo n.º 3
0
from idempierewsc.request import CreateDataRequest, UpdateDataRequest
from idempierewsc.base import LoginRequest
from idempierewsc.enums import WebServiceResponseStatus
from idempierewsc.net import WebServiceConnection
from idempierewsc.base import Field

from ui.models import *
import pymssql
import time

ad_url = 'http://apps.sisierp.id/'

login = LoginRequest()
login.client_id = 1000003
login.org_id = 1000006
login.role_id = 1000196
login.password = '******'
login.user = '******'
login.warehouse_id = 1000009

if True:
    ws = UpdateDataRequest()
    ws.web_service_type = 'ActivateEBatchLoadLine'
    ws.record_id = 1033324
    ws.login = login

    ws.data_row = [Field('IsActive', 'Y')]

    wsc = WebServiceConnection()
    wsc.url = ad_url
    wsc.attempts = 1