forked from elmau/empresa-libre
Fix - Issue 48
This commit is contained in:
parent
de675a0de1
commit
6644eef0ab
|
@ -1719,7 +1719,6 @@ class Productos(BaseModel):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_by(cls, values):
|
def get_by(cls, values):
|
||||||
# ~ id = int(values.get('id', 0))
|
|
||||||
clave = values.get('id', '')
|
clave = values.get('id', '')
|
||||||
if clave:
|
if clave:
|
||||||
row = (Productos
|
row = (Productos
|
||||||
|
@ -1732,7 +1731,8 @@ class Productos(BaseModel):
|
||||||
Productos.valor_unitario,
|
Productos.valor_unitario,
|
||||||
Productos.descuento)
|
Productos.descuento)
|
||||||
.join(SATUnidades).switch(Productos)
|
.join(SATUnidades).switch(Productos)
|
||||||
.where(Productos.clave==clave).dicts())
|
.where((Productos.id==clave) | (Productos.clave==clave))
|
||||||
|
.dicts())
|
||||||
if len(row):
|
if len(row):
|
||||||
id = row[0]['id']
|
id = row[0]['id']
|
||||||
model_pt = Productos.impuestos.get_through_model()
|
model_pt = Productos.impuestos.get_through_model()
|
||||||
|
|
Loading…
Reference in New Issue