Fix - En categorias nulas al importar
This commit is contained in:
commit
e196a5fac9
|
@ -2277,6 +2277,8 @@ class ImportFacturaLibre(object):
|
||||||
"""
|
"""
|
||||||
for row in rows:
|
for row in rows:
|
||||||
new = {t: row[s] for s, t in fields}
|
new = {t: row[s] for s, t in fields}
|
||||||
|
if new['categoria'] == 0:
|
||||||
|
new['categoria'] = None
|
||||||
new['descripcion'] = ' '.join(new['descripcion'].split())
|
new['descripcion'] = ' '.join(new['descripcion'].split())
|
||||||
new['clave_sat'] = DEFAULT_SAT_PRODUCTO
|
new['clave_sat'] = DEFAULT_SAT_PRODUCTO
|
||||||
self._cursor.execute(sql, (row['id'],))
|
self._cursor.execute(sql, (row['id'],))
|
||||||
|
|
|
@ -5554,7 +5554,7 @@ def _importar_productos(archivo):
|
||||||
try:
|
try:
|
||||||
obj = Productos.create(**new)
|
obj = Productos.create(**new)
|
||||||
obj.impuestos = taxes
|
obj.impuestos = taxes
|
||||||
except IntegrityError:
|
except IntegrityError as e:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
log.info('Importación terminada...')
|
log.info('Importación terminada...')
|
||||||
|
|
Loading…
Reference in New Issue