From 62356a997e2ee59a39242d8d12287d77c399d670 Mon Sep 17 00:00:00 2001 From: Faheedkhan Date: Tue, 8 Jul 2025 11:24:17 +0300 Subject: [PATCH] add --- inventory/models.py | 14 +-- inventory/signals.py | 7 +- templates/purchase_orders/po_detail.html | 86 +++++++++++-------- .../sales/estimates/sale_order_form1.html | 20 ++--- 4 files changed, 68 insertions(+), 59 deletions(-) diff --git a/inventory/models.py b/inventory/models.py index ee8a5dfb..4661ca7d 100644 --- a/inventory/models.py +++ b/inventory/models.py @@ -2644,7 +2644,7 @@ class CustomGroup(models.Model): allowed_models=[], other_perms=[ "view_purchaseordermodel", - "can_view_financials", + ] ) ###################################### @@ -2671,10 +2671,7 @@ class CustomGroup(models.Model): "organization", "notes", "tasks", -<<<<<<< HEAD -======= "lead" ->>>>>>> 25d17efa11e8f03c6819b27572ca6abe91860d11 "activity", ], other_perms=[ @@ -2704,14 +2701,7 @@ class CustomGroup(models.Model): "carfinance", "notes", "tasks", - "activity", -<<<<<<< HEAD - "vendor"], -======= - "vendor", - "poitemsuploaded" - ], ->>>>>>> 25d17efa11e8f03c6819b27572ca6abe91860d11 + "activity",], other_perms=[ "view_car", "view_carlocation", diff --git a/inventory/signals.py b/inventory/signals.py index 43cf2d93..31012666 100644 --- a/inventory/signals.py +++ b/inventory/signals.py @@ -963,7 +963,7 @@ def create_po_fulfilled_notification(sender,instance,created,**kwargs): @receiver(post_save, sender=models.Car) def car_created_notification(sender, instance, created, **kwargs): if created: - accountants = models.CustomGroup.objects.filter(dealer=instance.dealer,name__in=["Manager","Accountant"]).first().group.user_set.all() + accountants = models.CustomGroup.objects.filter(dealer=instance.dealer,name__in=["Manager","Accountant","Inventory"]).first().group.user_set.all().distinct() for accountant in accountants: models.Notification.objects.create( user=accountant, @@ -972,6 +972,9 @@ def car_created_notification(sender, instance, created, **kwargs): View """, ) + + + @receiver(post_save, sender=PurchaseOrderModel) def po_fullfilled_notification(sender, instance, created, **kwargs): if instance.is_fulfilled(): @@ -994,7 +997,7 @@ def vendor_created_notification(sender, instance, created, **kwargs): recipients = User.objects.filter( groups__customgroup__dealer=instance.dealer, groups__customgroup__name__in=["Manager", "Inventory"] - ) + ).distinct() for recipient in recipients: models.Notification.objects.create( diff --git a/templates/purchase_orders/po_detail.html b/templates/purchase_orders/po_detail.html index 0fab221f..9bb06a22 100644 --- a/templates/purchase_orders/po_detail.html +++ b/templates/purchase_orders/po_detail.html @@ -8,45 +8,61 @@
-
-
-
-
- {% include 'purchase_orders/includes/card_po.html' with dealer_slug=request.dealer.slug po_model=po_model entity_slug=entity_slug style='po-detail' %} -
+ +
+
+ +
+
+
+ {% include 'purchase_orders/includes/card_po.html' with dealer_slug=request.dealer.slug po_model=po_model entity_slug=entity_slug style='po-detail' %} +
+
+
+ +
+ +
+ +
+
+
+
+
+
+
{% trans 'PO Amount' %}
+

+ {{CURRENCY}}{{ po_model.po_amount | absolute | currency_format }} +

+
+
+
+
+
{% trans 'Amount Received' %}
+

+ {{CURRENCY}}{{ po_model.po_amount_received | currency_format }} +

+
+
+
+
+
+
+ + + + +
- - {% trans 'PO List' %} - -
+
-
-
-
-
-
-
-
{% trans 'PO Amount' %}
-

- {{CURRENCY}}{{ po_model.po_amount | absolute | currency_format }} -

-
-
-
-
-
{% trans 'Amount Received' %}
-

- {{CURRENCY}}{{ po_model.po_amount_received | currency_format }} -

-
-
-
-
-
-
diff --git a/templates/sales/estimates/sale_order_form1.html b/templates/sales/estimates/sale_order_form1.html index dfcb3077..f9445265 100644 --- a/templates/sales/estimates/sale_order_form1.html +++ b/templates/sales/estimates/sale_order_form1.html @@ -9,22 +9,22 @@ {% endblock customCSS %} @@ -75,7 +75,7 @@
-
+

New Sale Order