From 27a29d331cd3c281a0c0368583d44cd3dbc05f49 Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Sun, 3 Mar 2019 23:01:31 -0600 Subject: [PATCH] Delete files in render PDF --- source/app/controllers/util.py | 9 ++++++++- source/app/models/main.py | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/source/app/controllers/util.py b/source/app/controllers/util.py index f4c2e2b..e13da50 100644 --- a/source/app/controllers/util.py +++ b/source/app/controllers/util.py @@ -1666,12 +1666,19 @@ def to_pdf_from_json(rfc, version, data): if exists(path_logo): data['emisor']['logo2'] = path_logo + path_cbb = data['timbre']['path_cbb'] path = get_path_temp() + pdf = TemplateInvoice(path) pdf.custom_styles = custom_styles pdf.data = data pdf.render() - return read_file(path) + + data = read_file(path) + _kill(path) + _kill(path_cbb) + + return data def format_currency(value, currency, digits=2): diff --git a/source/app/models/main.py b/source/app/models/main.py index 95dd6db..8b74860 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -9913,6 +9913,7 @@ def _exportar_documentos(): Facturas.get_pdf(row['id'], rfc, True) msg = '\tPDF generado...' log.info(msg) + log.info('Documentos exportados...') return