Fix in import employes
This commit is contained in:
parent
e08e4e038f
commit
aea8aeaecf
|
@ -1667,10 +1667,11 @@ def html_to_pdf(data):
|
||||||
|
|
||||||
|
|
||||||
def import_employees(rfc):
|
def import_employees(rfc):
|
||||||
|
msg = 'No se pudo cargar el archivo'
|
||||||
name = '{}_employees.ods'.format(rfc.lower())
|
name = '{}_employees.ods'.format(rfc.lower())
|
||||||
path = _join(PATH_MEDIA, 'tmp', name)
|
path = _join(PATH_MEDIA, 'tmp', name)
|
||||||
if not is_file(path):
|
if not is_file(path):
|
||||||
return ()
|
return (), msg
|
||||||
|
|
||||||
msg = 'LibreOffice no se pudo iniciar'
|
msg = 'LibreOffice no se pudo iniciar'
|
||||||
if APP_LIBO:
|
if APP_LIBO:
|
||||||
|
|
|
@ -9021,7 +9021,7 @@ class Empleados(BaseModel):
|
||||||
try:
|
try:
|
||||||
q = Empleados.delete().where(Empleados.id==id)
|
q = Empleados.delete().where(Empleados.id==id)
|
||||||
return bool(q.execute())
|
return bool(q.execute())
|
||||||
except IntegrityError:
|
except Exception as e:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue