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)
|
||||
t = len(data)
|
||||
ok = 0
|
||||
for i, row in enumerate(data):
|
||||
msg = f'\tImportando cliente {i+1} de {t}'
|
||||
log.info(msg)
|
||||
|
@ -10534,7 +10535,7 @@ def _import_clients(rfc, path):
|
|||
|
||||
w = ((Socios.rfc==row['rfc']) & (Socios.slug==row['slug']))
|
||||
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)
|
||||
continue
|
||||
|
||||
|
@ -10543,11 +10544,16 @@ def _import_clients(rfc, path):
|
|||
|
||||
try:
|
||||
obj = Socios.create(**row)
|
||||
ok += 1
|
||||
except Exception as e:
|
||||
log.error(e)
|
||||
break
|
||||
|
||||
desconectar()
|
||||
msg = f'Total de clientes: {t}'
|
||||
log.info(msg)
|
||||
msg = f'Clientes nuevos: {ok}'
|
||||
log.info(msg)
|
||||
log.info('Proceso terminado correctamente...')
|
||||
return
|
||||
|
||||
|
|
Loading…
Reference in New Issue