#9 config(Tryton): read tryton params from environment.
This commit is contained in:
parent
3d9feeac43
commit
3a5e13624f
@ -12,6 +12,12 @@ from decimal import Decimal
|
||||
from sabatron_tryton_rpc_client.client import Client
|
||||
import io
|
||||
import csv
|
||||
import os
|
||||
|
||||
TRYTON_HOST = os.environ.get('TRYTON_HOST', 'localhost')
|
||||
TRYTON_DATABASE = os.environ.get('TRYTON_DATABASE', 'tryton')
|
||||
TRYTON_USERNAME = os.environ.get('TRYTON_USERNAME', 'admin')
|
||||
TRYTON_PASSWORD = os.environ.get('TRYTON_PASSWORD', 'admin')
|
||||
|
||||
|
||||
class Pagination(PageNumberPagination):
|
||||
@ -170,10 +176,10 @@ class SalesForTrytonView(APIView):
|
||||
class SalesToTrytonView(APIView):
|
||||
def post(self, request):
|
||||
tryton_client = Client(
|
||||
hostname='localhost',
|
||||
database='tryton',
|
||||
username='admin',
|
||||
password='admin'
|
||||
hostname=TRYTON_HOST,
|
||||
database=TRYTON_DATABASE,
|
||||
username=TRYTON_USERNAME,
|
||||
password=TRYTON_PASSWORD
|
||||
)
|
||||
tryton_client.connect()
|
||||
method = 'model.sale.sale.create'
|
||||
|
Loading…
Reference in New Issue
Block a user