change: add filters to inventory list api

This commit is contained in:
behruz-dev
2025-08-26 16:47:54 +05:00
parent 2ae04c76e9
commit 7a8efa74ff
5 changed files with 69 additions and 13 deletions

View File

@@ -4,11 +4,13 @@ from core.apps.wherehouse.models.inventory import Inventory
@shared_task
def create_inventory(wherehouse, quantity, product, unity, price):
def create_inventory(wherehouse, quantity, product, unity, price, project_folder, project):
Inventory.objects.create(
wherehouse_id=wherehouse,
quantity=quantity,
product_id=product,
unity_id=unity,
price=price
wherehouse_id=wherehouse,
quantity=quantity,
product_id=product,
unity_id=unity,
price=price,
project_folder_id=project_folder,
project_id=project,
)

View File

@@ -155,7 +155,9 @@ class PartyChangeStatusToIsMadeApiView(generics.GenericAPIView):
order.quantity,
order.product.id,
order.unity.id,
order.total_price
order.total_price,
order.project_folder.id if order.project_folder else None,
order.project.id if order.project else None,
)
return Response(
{'success': True, 'message': 'party updated'},