diff --git a/inventory/override.py b/inventory/override.py index f95ca4b3..7587fa2a 100644 --- a/inventory/override.py +++ b/inventory/override.py @@ -411,6 +411,22 @@ class BasePurchaseOrderActionActionView( f"while performing action '{self.action_name}' on Purchase Order ID: {po_model.pk}. " f"Error: {e}" ) + except Exception as e: + print( + f"User {user_username} encountered an exception " + f"while performing action '{self.action_name}' on Purchase Order ID: {po_model.pk}. " + f"Error: {e}" + ) + logger.warning( + f"User {user_username} encountered an exception " + f"while performing action '{self.action_name}' on Purchase Order ID: {po_model.pk}. " + f"Error: {e}" + ) + messages.add_message( + request, + message=f"Failed to update PO {po_model.po_number}. {e}", + level=messages.ERROR, + ) return response diff --git a/inventory/views.py b/inventory/views.py index 8c9cc63a..220bb70a 100644 --- a/inventory/views.py +++ b/inventory/views.py @@ -5005,7 +5005,7 @@ def create_estimate(request, dealer_slug, slug=None): customer = opportunity.customer print(customer) form.fields["customer"].queryset = models.Customer.objects.filter( - pk=customer.pk + pk=customer.pk ) form.initial["customer"] = customer @@ -11161,9 +11161,9 @@ class PurchaseOrderModelDeleteView(PurchaseOrderModelDeleteViewBase): level=messages.SUCCESS, ) return reverse( - "purchase_order_list", kwargs={"dealer_slug": self.kwargs["dealer_slug"],"entity_slug":self.kwargs['entity_slug']} + "purchase_order_list", kwargs={"dealer_slug": self.kwargs["dealer_slug"], "entity_slug": self.kwargs["entity_slug"]} ) - + class PurchaseOrderMarkAsDraftView(BasePurchaseOrderActionActionView): diff --git a/templates/components/note_modal.html b/templates/components/note_modal.html index f27afd9c..7934052c 100644 --- a/templates/components/note_modal.html +++ b/templates/components/note_modal.html @@ -22,6 +22,7 @@ hx-target="#notesTable" hx-on::after-request="{ resetSubmitButton(document.querySelector('.add_note_form button[type=submit]')); $('#noteModal').modal('hide'); }" hx-swap="outerHTML show:window.top" + hx-select-oob="#timeline" method="post" class="add_note_form"> {% csrf_token %} diff --git a/templates/components/schedule_modal.html b/templates/components/schedule_modal.html index de29e3f0..f154aa5c 100644 --- a/templates/components/schedule_modal.html +++ b/templates/components/schedule_modal.html @@ -22,7 +22,7 @@ hx-target=".taskTable" hx-on::after-request="{ resetSubmitButton(document.querySelector('.add_schedule_form button[type=submit]')); $('#scheduleModal').modal('hide'); }" hx-swap="outerHTML" - hx-select-oob="#toast-container:outerHTML" + hx-select-oob="#toast-container:outerHTML,#timeline:outerHTML" method="post" class="add_schedule_form"> {% csrf_token %} diff --git a/templates/crm/leads/lead_detail.html b/templates/crm/leads/lead_detail.html index b29ab68c..a51c1c63 100644 --- a/templates/crm/leads/lead_detail.html +++ b/templates/crm/leads/lead_detail.html @@ -335,7 +335,7 @@
-
+
{% for activity in activities %}
@@ -353,7 +353,9 @@ {% elif activity.activity_type == "visit" %} {% elif activity.activity_type == "whatsapp" %} - + + {% elif activity.activity_type == "meeting" %} + {% endif %}
{% if forloop.last %} diff --git a/templates/inventory/car_detail.html b/templates/inventory/car_detail.html index a0c300fd..81f72f57 100644 --- a/templates/inventory/car_detail.html +++ b/templates/inventory/car_detail.html @@ -542,7 +542,7 @@ data-bs-dismiss="modal" aria-label="Close">
-
+
{% csrf_token %} {{estimate_form|crispy}} diff --git a/templates/ledger/bills/bill_list.html b/templates/ledger/bills/bill_list.html index 446ca5f1..9bc79a8c 100644 --- a/templates/ledger/bills/bill_list.html +++ b/templates/ledger/bills/bill_list.html @@ -49,6 +49,8 @@ {% elif bill.is_canceled %} + {% elif bill.is_void %} + {% endif %} {{ bill.bill_status }} diff --git a/templates/purchase_orders/includes/card_po.html b/templates/purchase_orders/includes/card_po.html index af856b04..83d53da4 100644 --- a/templates/purchase_orders/includes/card_po.html +++ b/templates/purchase_orders/includes/card_po.html @@ -155,12 +155,14 @@
{% endif %} {% endif %} - {% if po_model.can_void %} + {% comment %} TODO: upgrade djnago ledger or replace core functionality {% endcomment %} + {% comment %} issue with django ledger base functionality when marking as void throughs error , will be fix in future {% endcomment %} + {% comment %} {% if po_model.can_void %} - {% endif %} + {% endif %} {% endcomment %} {% if po_model.can_cancel %} {% endif %} - {% trans 'Unit Cost' %} {% trans 'Quantity' %} + {% trans 'Unit Cost' %} {% trans 'Unit' %} {% trans 'Amount' %} {% trans 'Status' %} @@ -52,8 +52,8 @@ {{ f.item_model|add_class:"form-control" }} {% if f.errors %}
{{ f.errors }}
{% endif %} - {{ f.po_unit_cost|add_class:"form-control" }} {{ f.po_quantity|add_class:"form-control" }} + {{ f.po_unit_cost|add_class:"form-control" }} {{ f.entity_unit|add_class:"form-control" }} {{ CURRENCY }}{{ f.instance.po_total_amount | currency_format }}