From 80f0d40850c0ae6182aade8dc64dee24a041a740 Mon Sep 17 00:00:00 2001 From: gitea Date: Mon, 17 Feb 2025 12:09:37 +0000 Subject: [PATCH] update --- inventory/views.py | 1 - scripts/run.py | 12 +++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/inventory/views.py b/inventory/views.py index f7086697..f1ef3346 100644 --- a/inventory/views.py +++ b/inventory/views.py @@ -1040,7 +1040,6 @@ def car_transfer_accept_reject(request, car_pk, transfer_pk): if success: messages.success(request, _("Car Transfer Completed successfully.")) models.Activity.objects.create(content_object=car,notes=f"Transfered from {transfer.from_dealer} to {transfer.to_dealer}",created_by=request.user) - models.Notification.objects.create( user=transfer.from_dealer.user, message=f"Car transfer request from {transfer.to_dealer} is completed.", diff --git a/scripts/run.py b/scripts/run.py index 10581ba2..ab70e21c 100644 --- a/scripts/run.py +++ b/scripts/run.py @@ -1,7 +1,7 @@ from django_ledger.models.invoice import InvoiceModel from django_ledger.utils import accruable_net_summary from decimal import Decimal -from django_ledger.models import EstimateModel,EntityModel,ItemModel,ItemTransactionModel,AccountModel +from django_ledger.models import EstimateModel,EntityModel,ItemModel,ItemTransactionModel,AccountModel,CustomerModel from rich import print from datetime import date from inventory.models import Car, Dealer, VatRate,Lead,CarMake,CarModel,Schedule @@ -116,5 +116,11 @@ def run(): # info = item.additional_info["car_info"] # finance = item.additional_info["car_finance"] # print({"vin":info["make"],"mode":info["model"],"year":info["year"],"trim":info["trim"],"mileage":info["mileage"],"cost_price":finance["cost_price"],"selling_price":finance["selling_price"]}) - for account in AccountModel.objects.all(): - print(account.path) \ No newline at end of file + # for account in AccountModel.objects.all(): + # print(account.path) + + # print(CustomerModel.objects.all()) + # customer = CustomerModel.objects.first() + dealer = Dealer.objects.filter(user__email="esma3el555@gmail.com").first() + customer = CustomerModel.objects.filter(dealer=dealer).first() + print(Car.objects.filter(dealer=dealer,status="available")) \ No newline at end of file