mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
feat: criado funcções de movimentação de estoque
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user