forked from elmau/empresa-libre
Report log
This commit is contained in:
parent
892906c46f
commit
66d740e8d1
|
@ -10525,6 +10525,7 @@ def _import_clients(rfc, path):
|
||||||
|
|
||||||
data = utils.read_csv(path)
|
data = utils.read_csv(path)
|
||||||
t = len(data)
|
t = len(data)
|
||||||
|
ok = 0
|
||||||
for i, row in enumerate(data):
|
for i, row in enumerate(data):
|
||||||
msg = f'\tImportando cliente {i+1} de {t}'
|
msg = f'\tImportando cliente {i+1} de {t}'
|
||||||
log.info(msg)
|
log.info(msg)
|
||||||
|
@ -10534,7 +10535,7 @@ def _import_clients(rfc, path):
|
||||||
|
|
||||||
w = ((Socios.rfc==row['rfc']) & (Socios.slug==row['slug']))
|
w = ((Socios.rfc==row['rfc']) & (Socios.slug==row['slug']))
|
||||||
if Socios.select().where(w).exists():
|
if Socios.select().where(w).exists():
|
||||||
msg = 'Ya existe el RFC y Razón Social'
|
msg = '\tYa existe el RFC y Razón Social'
|
||||||
log.info(msg)
|
log.info(msg)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -10543,11 +10544,16 @@ def _import_clients(rfc, path):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
obj = Socios.create(**row)
|
obj = Socios.create(**row)
|
||||||
|
ok += 1
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(e)
|
log.error(e)
|
||||||
break
|
break
|
||||||
|
|
||||||
desconectar()
|
desconectar()
|
||||||
|
msg = f'Total de clientes: {t}'
|
||||||
|
log.info(msg)
|
||||||
|
msg = f'Clientes nuevos: {ok}'
|
||||||
|
log.info(msg)
|
||||||
log.info('Proceso terminado correctamente...')
|
log.info('Proceso terminado correctamente...')
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue