From 6785dfebf7ed873bc47b4bb1b4a247b02fc72ba0 Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Mon, 11 Jan 2021 14:43:28 -0600 Subject: [PATCH] Fix get version in proforma --- source/app/controllers/util.py | 5 +++-- source/app/models/main.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/source/app/controllers/util.py b/source/app/controllers/util.py index 90d731e..180979a 100644 --- a/source/app/controllers/util.py +++ b/source/app/controllers/util.py @@ -1140,8 +1140,9 @@ class LIBO(object): return def _others_values(self, data): - version = data['version'] - self._set_cell('{version}', version) + version = data.get('version', '') + if version: + self._set_cell('{version}', version) return def pdf(self, path, data, ods=False): diff --git a/source/app/models/main.py b/source/app/models/main.py index c44aa00..6eae17b 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -10497,6 +10497,32 @@ def _migrate_cert(rfc): return +def _test(rfc): + if not rfc: + rfc = input('Introduce el RFC: ').strip().upper() + + if not rfc: + msg = 'El RFC es requerido' + log.error(msg) + return + + args = util.get_con(rfc) + if not args: + return + + conectar(args) + log.info('Test con...') + + query = Socios.select(Socios.id, Socios.nombre, Socios.rfc).where(Socios.nombre.contains('Lopez')) + print(query) + + desconectar() + log.info('End test...') + return + + + + def _process_command_line_arguments(): parser = argparse.ArgumentParser( description='Empresa Libre') @@ -10569,6 +10595,8 @@ def main(args): _migrate_cert(args.rfc) return + # ~ _test(args.rfc) + return