Show message when delete product

This commit is contained in:
el Mau 2023-02-16 22:30:08 -06:00
parent ae5949c529
commit 709c524830
1 changed files with 8 additions and 0 deletions

View File

@ -4335,6 +4335,14 @@ class Productos(BaseModel):
if count:
return False
count = (TicketsDetalle
.select(fn.COUNT(TicketsDetalle.id)).join(Productos)
.where(Productos.id==id)
.count()
)
if count:
return False
with database_proxy.transaction():
obj = Productos.get(Productos.id==id)
obj.impuestos.clear()