From 71884e9984980a71b4425d4e76de08771b3671d9 Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Fri, 29 Dec 2017 02:36:13 -0600 Subject: [PATCH] Fix - PDF cuando no hay areas de impresion --- source/app/controllers/util.py | 6 +++++- source/db/valores_iniciales.json | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/source/app/controllers/util.py b/source/app/controllers/util.py index 73cd8e6..16a174c 100644 --- a/source/app/controllers/util.py +++ b/source/app/controllers/util.py @@ -666,7 +666,11 @@ class LIBO(object): def _set_search(self): self._sheet = self._template.getSheets().getByIndex(0) - self._search = self._sheet.getPrintAreas()[0] + try: + self._search = self._sheet.getPrintAreas()[0] + except IndexError: + self._search = self._sheet.getRangeAddress() + self._search = self._sheet.getCellRangeByPosition( self._search.StartColumn, self._search.StartRow, diff --git a/source/db/valores_iniciales.json b/source/db/valores_iniciales.json index 1556317..107b880 100644 --- a/source/db/valores_iniciales.json +++ b/source/db/valores_iniciales.json @@ -27,7 +27,8 @@ {"key": "ACT", "name": "Actividad", "activo": false}, {"key": "KGM", "name": "Kilogramo", "activo": false}, {"key": "XBX", "name": "Caja", "activo": false}, - {"key": "XRO", "name": "Rollo", "activo": false} + {"key": "XRO", "name": "Rollo", "activo": false}, + {"key": "MTR", "name": "Metro", "activo": false} ] }, {