Fix - En categorias nulas al importar

This commit is contained in:
Mauricio Baeza 2018-01-12 20:14:09 -06:00
commit e196a5fac9
2 changed files with 3 additions and 1 deletions

View File

@ -2277,6 +2277,8 @@ class ImportFacturaLibre(object):
"""
for row in rows:
new = {t: row[s] for s, t in fields}
if new['categoria'] == 0:
new['categoria'] = None
new['descripcion'] = ' '.join(new['descripcion'].split())
new['clave_sat'] = DEFAULT_SAT_PRODUCTO
self._cursor.execute(sql, (row['id'],))

View File

@ -5554,7 +5554,7 @@ def _importar_productos(archivo):
try:
obj = Productos.create(**new)
obj.impuestos = taxes
except IntegrityError:
except IntegrityError as e:
pass
log.info('Importación terminada...')