forked from elmau/empresa-libre
Fix - nuevas unidades
This commit is contained in:
parent
35806fcfcb
commit
012936cc67
|
@ -5137,6 +5137,12 @@ def _get_id_unidad(unidad):
|
||||||
unidad = 'pieza'
|
unidad = 'pieza'
|
||||||
if 'metros' in unidad.lower():
|
if 'metros' in unidad.lower():
|
||||||
unidad = 'metro'
|
unidad = 'metro'
|
||||||
|
if 'tramo' in unidad.lower():
|
||||||
|
unidad = 'paquete'
|
||||||
|
if 'juego' in unidad.lower():
|
||||||
|
unidad = 'par'
|
||||||
|
if 'bolsa' in unidad.lower():
|
||||||
|
unidad = 'globo'
|
||||||
obj = SATUnidades.get(SATUnidades.name.contains(unidad))
|
obj = SATUnidades.get(SATUnidades.name.contains(unidad))
|
||||||
except SATUnidades.DoesNotExist:
|
except SATUnidades.DoesNotExist:
|
||||||
msg = '\tNo se encontró la unidad: {}'.format(unidad)
|
msg = '\tNo se encontró la unidad: {}'.format(unidad)
|
||||||
|
|
|
@ -813,7 +813,7 @@ var suggest_sat_unidad = {
|
||||||
{id: 'name', adjust: 'data', header: 'Unidad'},
|
{id: 'name', adjust: 'data', header: 'Unidad'},
|
||||||
],
|
],
|
||||||
dataFeed:function(text){
|
dataFeed:function(text){
|
||||||
if (text.length > 2){
|
if (text.length > 1){
|
||||||
this.load('/values/satunidades?key=' + text)
|
this.load('/values/satunidades?key=' + text)
|
||||||
}else{
|
}else{
|
||||||
this.hide()
|
this.hide()
|
||||||
|
|
Loading…
Reference in New Issue