forked from elmau/empresa-libre
Show message when delete product
This commit is contained in:
parent
ae5949c529
commit
709c524830
|
@ -4335,6 +4335,14 @@ class Productos(BaseModel):
|
||||||
if count:
|
if count:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
count = (TicketsDetalle
|
||||||
|
.select(fn.COUNT(TicketsDetalle.id)).join(Productos)
|
||||||
|
.where(Productos.id==id)
|
||||||
|
.count()
|
||||||
|
)
|
||||||
|
if count:
|
||||||
|
return False
|
||||||
|
|
||||||
with database_proxy.transaction():
|
with database_proxy.transaction():
|
||||||
obj = Productos.get(Productos.id==id)
|
obj = Productos.get(Productos.id==id)
|
||||||
obj.impuestos.clear()
|
obj.impuestos.clear()
|
||||||
|
|
Loading…
Reference in New Issue