Delete files in render PDF

This commit is contained in:
Mauricio Baeza 2019-03-03 23:01:31 -06:00
parent 7a709f056c
commit 27a29d331c
2 changed files with 9 additions and 1 deletions

View File

@ -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):

View File

@ -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