Fix - Issue 48

This commit is contained in:
Mauricio Baeza 2017-12-10 00:26:49 -06:00
parent de675a0de1
commit 6644eef0ab
1 changed files with 2 additions and 2 deletions

View File

@ -1719,7 +1719,6 @@ class Productos(BaseModel):
@classmethod
def get_by(cls, values):
# ~ id = int(values.get('id', 0))
clave = values.get('id', '')
if clave:
row = (Productos
@ -1732,7 +1731,8 @@ class Productos(BaseModel):
Productos.valor_unitario,
Productos.descuento)
.join(SATUnidades).switch(Productos)
.where(Productos.clave==clave).dicts())
.where((Productos.id==clave) | (Productos.clave==clave))
.dicts())
if len(row):
id = row[0]['id']
model_pt = Productos.impuestos.get_through_model()