ajout changement de client d'un rdf

This commit is contained in:
2020-05-13 15:40:29 +02:00
parent bbd462cd54
commit 5ddbc49fec
11 changed files with 197 additions and 51 deletions

View File

@@ -27,7 +27,8 @@ import json
from ..models.default import *
from ..models.agenda import *
from ..models.dossier import (
get_chantiers_byName
get_chantiers_byName,
get_clients_byName
)
def to_decimal(x):
@@ -295,4 +296,19 @@ def ajax_lookup(request):
return Response(json.dumps(liste))
@view_config(route_name='ajax_client')
def ajax_client(request):
recherche = request.GET['recherche']
societe = recherche[:2] # 1er car.
name = recherche[2:]
# lire les clients
clients = get_clients_byName(request, societe, name)
liste=[]
for row in clients:
d = "%s | %s-%s"% (row.NOM, societe, row.CD_CLI)
liste.append(d)
return Response(json.dumps(liste))