diff --git a/source/app/controllers/util.py b/source/app/controllers/util.py index 896a7d1..4b4f8be 100644 --- a/source/app/controllers/util.py +++ b/source/app/controllers/util.py @@ -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'],)) diff --git a/source/app/models/main.py b/source/app/models/main.py index fa9fc40..f1adfde 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -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...')