feat: gerenciamento quantidade product

This commit is contained in:
2025-07-18 18:24:21 -03:00
parent 672af857a0
commit a20fa6d583
21 changed files with 63 additions and 41 deletions

View File

@@ -16,4 +16,12 @@ class Product(models.Model):
active = models.BooleanField(default=True)
def __str__(self) -> str:
return f"{self.id} - {self.name} - {self.price} - {self.category} - {self.cuisine} - {self.active} "
return f"{self.name}"
def subStock(self, qtd):
self.quantity -= qtd
self.save()
def addStock(self, qtd):
self.quantity += qtd
self.save()