Fix - Al mostrar el título

This commit is contained in:
Mauricio Baeza 2018-06-25 22:56:02 -05:00
parent dc1f48cc0b
commit a8405a98fb
8 changed files with 25 additions and 9 deletions

View File

@ -1,3 +1,9 @@
v 1.9.1 [25-jun-2018]
---------------------
- Fix: Al mostrar el título de la aplicación
- Se agrega el registro de acción al borrar una factura
v 1.9.0 [18-jun-2018] v 1.9.0 [18-jun-2018]
--------------------- ---------------------
- Se agrega la vista del detalle de facturas - Se agrega la vista del detalle de facturas

View File

@ -1 +1 @@
1.9.0 1.9.1

View File

@ -8,6 +8,7 @@ MV = True
# ~ una nueva base de datos, personaliza por la que quieras. # ~ una nueva base de datos, personaliza por la que quieras.
DEFAULT_PASSWORD = 'salgueiro3.3' DEFAULT_PASSWORD = 'salgueiro3.3'
TITLE_APP = 'Empresa Libre'
#~ Establece una ruta accesible para el servidor web #~ Establece una ruta accesible para el servidor web
LOG_PATH = '/home/empresa/.opt/empresa-libre.log' LOG_PATH = '/home/empresa/.opt/empresa-libre.log'

View File

@ -110,8 +110,7 @@ class AppValues(object):
def on_get(self, req, resp, table): def on_get(self, req, resp, table):
values = req.params values = req.params
session = req.env['beaker.session'] session = req.env['beaker.session']
if req.path in ('/values/titlelogin', '/values/empresas'):
if req.path in ('values/titlelogin', '/values/empresas'):
req.context['result'] = self._db.get_values(table, values, session) req.context['result'] = self._db.get_values(table, values, session)
resp.status = falcon.HTTP_200 resp.status = falcon.HTTP_200
return return
@ -313,7 +312,8 @@ class AppInvoices(object):
def on_delete(self, req, resp): def on_delete(self, req, resp):
values = req.params values = req.params
if self._db.delete('invoice', values['id']): session = req.env['beaker.session']
if self._db.delete('invoice', values['id'], session['userobj']):
resp.status = falcon.HTTP_200 resp.status = falcon.HTTP_200
else: else:
resp.status = falcon.HTTP_204 resp.status = falcon.HTTP_204

View File

@ -19,6 +19,8 @@ from zeep.plugins import HistoryPlugin
from zeep.cache import SqliteCache from zeep.cache import SqliteCache
from zeep.transports import Transport from zeep.transports import Transport
from zeep.exceptions import Fault, TransportError from zeep.exceptions import Fault, TransportError
from requests.exceptions import ConnectionError
if __name__ == '__main__': if __name__ == '__main__':
from configpac import DEBUG, TIMEOUT, AUTH, URL from configpac import DEBUG, TIMEOUT, AUTH, URL
@ -268,6 +270,10 @@ class Finkok(object):
else: else:
self.error = str(e) self.error = str(e)
return return
except ConnectionError as e:
msg = '502 - Error de conexión'
self.error = msg
return
return self._check_result(method, result) return self._check_result(method, result)

View File

@ -256,13 +256,13 @@ class StorageEngine(object):
def _get_ebancomov(self, values): def _get_ebancomov(self, values):
return main.MovimientosBanco.con(values['id']) return main.MovimientosBanco.con(values['id'])
def delete(self, table, id): def delete(self, table, id, user=None):
if table == 'partner': if table == 'partner':
return main.Socios.remove(id) return main.Socios.remove(id)
if table == 'product': if table == 'product':
return main.Productos.remove(id) return main.Productos.remove(id)
if table == 'invoice': if table == 'invoice':
return main.Facturas.remove(id) return main.Facturas.remove(id, user)
if table == 'folios': if table == 'folios':
return main.Folios.remove(id) return main.Folios.remove(id)
if table == 'preinvoice': if table == 'preinvoice':

View File

@ -3666,7 +3666,7 @@ class Facturas(BaseModel):
return {'ok': True, 'rows': rows} return {'ok': True, 'rows': rows}
@classmethod @classmethod
def remove(cls, id): def remove(cls, id, user):
obj = Facturas.get(Facturas.id==id) obj = Facturas.get(Facturas.id==id)
if obj.uuid: if obj.uuid:
return False return False
@ -3678,6 +3678,10 @@ class Facturas(BaseModel):
q = FacturasRelacionadas.delete().where(FacturasRelacionadas.factura==obj) q = FacturasRelacionadas.delete().where(FacturasRelacionadas.factura==obj)
q.execute() q.execute()
Tickets.uncancel(obj) Tickets.uncancel(obj)
m = 'B {}'.format(obj.id)
_save_log(user.usuario, m, 'F')
return bool(obj.delete_instance()) return bool(obj.delete_instance())
def _get_folio(self, serie): def _get_folio(self, serie):

View File

@ -31,7 +31,7 @@ except ImportError:
DEBUG = DEBUG DEBUG = DEBUG
VERSION = '1.9.0' VERSION = '1.9.1'
EMAIL_SUPPORT = ('soporte@empresalibre.net',) EMAIL_SUPPORT = ('soporte@empresalibre.net',)
TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION) TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)
@ -62,7 +62,6 @@ template_lookup = TemplateLookup(directories=[PATH_TEMPLATES],
input_encoding='utf-8', input_encoding='utf-8',
output_encoding='utf-8') output_encoding='utf-8')
LOG_PATH = 'empresalibre.log'
LOG_NAME = 'API' LOG_NAME = 'API'
LOG_LEVEL = 'INFO' LOG_LEVEL = 'INFO'