feat: criado funcções de movimentação de estoque

This commit is contained in:
2025-07-22 18:22:41 -03:00
parent a9289cb28d
commit 37428e8cc7
15 changed files with 164 additions and 23 deletions

View File

@@ -1,6 +1,11 @@
from django.contrib import admin
from products.models import Product
from products.models import Product, ProductComponent, UnitOfMeasure
admin.site.register(Product)
admin.site.register(ProductComponent)
admin.site.register(UnitOfMeasure)

View File

@@ -2,7 +2,6 @@ from django.db import models
from django.contrib.auth.models import User
from categories.models import Categories
# from comandas.models import Comanda
@@ -47,14 +46,6 @@ class Product(models.Model):
def __str__(self) -> str:
return f"{self.name}"
def subStock(self, qtd):
self.quantity -= qtd
self.save()
def addStock(self, qtd):
self.quantity += qtd
self.save()
class ProductComponent(models.Model):