From 50589389bbec9d7e3a3ec5c6b3a378e4578d48fa Mon Sep 17 00:00:00 2001 From: Faheed Date: Sun, 21 Sep 2025 13:18:21 +0300 Subject: [PATCH] delete po fixed --- inventory/views.py | 3 +- .../plans/billing_info_create_or_update.html | 3 +- .../purchase_orders/includes/card_po.html | 24 +++++++++--- .../purchase_orders/po_confirm_delete.html | 31 ++++++---------- templates/purchase_orders/po_delete.html | 37 ------------------- templates/sales/invoices/invoice_detail.html | 4 +- 6 files changed, 36 insertions(+), 66 deletions(-) delete mode 100644 templates/purchase_orders/po_delete.html diff --git a/inventory/views.py b/inventory/views.py index c74e7fca..8c9cc63a 100644 --- a/inventory/views.py +++ b/inventory/views.py @@ -11152,7 +11152,6 @@ class BasePurchaseOrderActionActionView(BasePurchaseOrderActionActionViewBase): class PurchaseOrderModelDeleteView(PurchaseOrderModelDeleteViewBase): - template_name = "purchase_orders/po_delete.html" permission_required = "django_ledger.delete_purchaseordermodel" def get_success_url(self): @@ -11162,7 +11161,7 @@ class PurchaseOrderModelDeleteView(PurchaseOrderModelDeleteViewBase): level=messages.SUCCESS, ) return reverse( - "purchase_order_list", kwargs={"dealer_slug": self.kwargs["dealer_slug"]} + "purchase_order_list", kwargs={"dealer_slug": self.kwargs["dealer_slug"],"entity_slug":self.kwargs['entity_slug']} ) diff --git a/templates/plans/billing_info_create_or_update.html b/templates/plans/billing_info_create_or_update.html index a63bd0c1..34f5da3f 100644 --- a/templates/plans/billing_info_create_or_update.html +++ b/templates/plans/billing_info_create_or_update.html @@ -19,6 +19,7 @@ method="post" class="needs-validation" novalidate> {% csrf_token %} {{ form|crispy }} + @@ -27,7 +28,7 @@ {{ _("Cancel") }} + type="submit">{{ _("Go Back") }} diff --git a/templates/purchase_orders/includes/card_po.html b/templates/purchase_orders/includes/card_po.html index d5f057c4..af856b04 100644 --- a/templates/purchase_orders/includes/card_po.html +++ b/templates/purchase_orders/includes/card_po.html @@ -45,7 +45,7 @@ href="{% url 'purchase_order_list' request.dealer.slug request.dealer.entity.slug %}" title="Click to view the complete list of Purchase Orders" role="button"> - {% trans 'PO List' %} + {% trans 'Purchase Order List' %}
- {% trans "Are you sure you want to delete the Purchase Order" %} "{{ object.po_number }}"? -
+ {% blocktrans with po_number=po_model.po_number %} + Are you sure you want to delete #{{ po_number }}? + {% endblocktrans %} +
- {% trans "All transactions associated with this Purchase Order will be deleted.If you want to void the PO instead," %} - {% trans "click here" %} -