diff --git a/inventory/views.py b/inventory/views.py index 37e3adb4..9195727d 100644 --- a/inventory/views.py +++ b/inventory/views.py @@ -1573,12 +1573,25 @@ class CarDeleteView( model = models.Car template_name = "inventory/car_confirm_delete.html" - success_url = reverse_lazy("inventory_stats") + permission_required = ["inventory.delete_car"] def delete(self, request, *args, **kwargs): messages.success(request, _("Car deleted successfully")) return super().delete(request, *args, **kwargs) + def get_success_url(self): + """ + Returns the URL to redirect to after a successful car deletion. + It dynamically includes the dealer_slug from the URL. + """ + + dealer_slug = self.kwargs.get('dealer_slug') + if dealer_slug: + return reverse_lazy("car_list", kwargs={'dealer_slug': dealer_slug}) + else: + + messages.error(self.request, _("Could not determine dealer for redirection.")) + return reverse_lazy("home") class CarLocationCreateView(LoginRequiredMixin, PermissionRequiredMixin, CreateView): diff --git a/templates/purchase_orders/po_detail.html b/templates/purchase_orders/po_detail.html index 7455e398..672fa591 100644 --- a/templates/purchase_orders/po_detail.html +++ b/templates/purchase_orders/po_detail.html @@ -7,7 +7,7 @@ {% block content %}
- +
@@ -23,8 +23,7 @@
- -
+
@@ -47,42 +46,20 @@
-
-<<<<<<< HEAD -
- -
-
-
-
-

{{ po_model.po_title }}

-======= +
->>>>>>> c9fad7b79c346875a636122fdc7514814180dbc7 - -
- {% po_item_table1 po_items %} -
-
+
+
+ {% po_item_table1 po_items %}
-
-<<<<<<< HEAD + + +
- -
- -======= - - - {% trans 'PO List' %} - -
->>>>>>> c9fad7b79c346875a636122fdc7514814180dbc7 + {% include "purchase_orders/includes/mark_as.html" %} -
{% endblock %} diff --git a/templates/sales/estimates/estimate_detail.html b/templates/sales/estimates/estimate_detail.html index cf2ca8b9..a4df4d64 100644 --- a/templates/sales/estimates/estimate_detail.html +++ b/templates/sales/estimates/estimate_detail.html @@ -74,12 +74,6 @@
- {% if estimate.invoicemodel_set.first %} - - {{ _("View Invoice")}} - - {% endif %} - {% if estimate.status == 'draft' %} {% trans 'Send Quotation' %} @@ -87,16 +81,23 @@ {% elif estimate.status == 'approved' %} - {% if estimate.sale_orders.first %} - {% trans 'Create Invoice' %} - {{ _("Preview Sale Order") }} - {% else %} + {% if estimate.sale_orders.first %} + + + {{ _("Preview Sale Order") }} + + {% else %} {% trans 'Create Sale Order' %} {% comment %} {% endcomment %} - {% endif %} - {% elif estimate.status == 'in_review' %} - {% trans 'Preview' %} + {% endif %} + + + {% elif estimate.status == 'completed' %} + {{ _("Preview Sale Order") }} + + {{ _("View Invoice")}} {% endif %} + {% if estimate.can_cancel %} {% if perms.django_ledger.change_estimatemodel %}