add: add new field to Inventory model

This commit is contained in:
behruz-dev
2025-08-27 10:25:09 +05:00
parent 8fde368204
commit 500143fb09
4 changed files with 31 additions and 10 deletions

View File

@@ -4,13 +4,14 @@ from core.apps.wherehouse.models.inventory import Inventory
@shared_task
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,
project_folder_id=project_folder,
project_id=project,
)
def create_inventory(wherehouse, quantity, product, unity, price, project_folder, project, unity_price):
Inventory.objects.create(
wherehouse_id=wherehouse,
quantity=quantity,
product_id=product,
unity_id=unity,
price=price,
project_folder_id=project_folder,
project_id=project,
unit_price=unity_price
)

View File

@@ -158,6 +158,7 @@ class PartyChangeStatusToIsMadeApiView(generics.GenericAPIView):
order.unit_amount * order.quantity,
order.project_folder.id if order.project_folder else None,
order.project.id if order.project else None,
order.unit_amount,
)
return Response(
{'success': True, 'message': 'party updated'},