diff --git a/source/app/controllers/main.py b/source/app/controllers/main.py index 7943af5..1b333ed 100644 --- a/source/app/controllers/main.py +++ b/source/app/controllers/main.py @@ -2,6 +2,7 @@ import falcon from middleware import get_template +from urllib.parse import unquote class AppEmpresas(object): @@ -111,6 +112,14 @@ class AppValues(object): def on_get(self, req, resp, table): values = req.params session = req.env['beaker.session'] + + if table == 'product': + original = values['name'] + try: + values['name'] = unquote(req.query_string.split('=')[1]) + except Exception as e: + values['name'] = original + if req.path in ('/values/titlelogin', '/values/empresas'): req.context['result'] = self._db.get_values(table, values, session) resp.status = falcon.HTTP_200 @@ -280,6 +289,7 @@ class AppProducts(object): def on_get(self, req, resp): values = req.params user = req.env['beaker.session']['userobj'] + if 'opt' in values: req.context['result'] = self._db.products_get(values, user) else: diff --git a/source/static/js/controller/invoices.js b/source/static/js/controller/invoices.js index 8b2802c..6fd607f 100644 --- a/source/static/js/controller/invoices.js +++ b/source/static/js/controller/invoices.js @@ -1097,22 +1097,6 @@ function search_product_by_key(key){ } } }) - - //~ webix.ajax().get('/values/productokey', {'key': key}, { - //~ error: function(text, data, xhr) { - //~ msg_error('Error al consultar') - //~ }, - //~ success: function(text, data, xhr){ - //~ var values = data.json() - //~ if (values.ok){ - //~ set_product(values) - //~ } else { - //~ msg = 'No se encontrĂ³ un producto con la clave: ' + key - //~ msg_error(msg) - //~ } - //~ } - //~ }) - }