update
This commit is contained in:
parent
8f14f9bfc9
commit
525a62ab3a
@ -1273,17 +1273,6 @@ class OpportunityForm(forms.ModelForm):
|
|||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
print(kwargs)
|
|
||||||
dealer = kwargs.pop('dealer', None)
|
|
||||||
print(dealer)
|
|
||||||
|
|
||||||
# Apply filtering if a dealer is provided
|
|
||||||
if dealer:
|
|
||||||
# Assuming Car model has an 'entity' ForeignKey and Dealer has an 'entity' attribute
|
|
||||||
self.fields['car'].queryset = Car.objects.filter(entity=dealer.entity)
|
|
||||||
|
|
||||||
# Assuming Lead model has an 'entity' ForeignKey and Dealer has an 'entity' attribute
|
|
||||||
self.fields['lead'].queryset = Lead.objects.filter(entity=dealer.entity)
|
|
||||||
# Add a visible number input to display the current value
|
# Add a visible number input to display the current value
|
||||||
self.fields["probability"].widget.attrs["class"] = (
|
self.fields["probability"].widget.attrs["class"] = (
|
||||||
"d-none" # Hide the default input
|
"d-none" # Hide the default input
|
||||||
|
|||||||
@ -208,7 +208,7 @@ urlpatterns = [
|
|||||||
path("notifications/fetch/", views.fetch_notifications, name="fetch_notifications"),
|
path("notifications/fetch/", views.fetch_notifications, name="fetch_notifications"),
|
||||||
|
|
||||||
path(
|
path(
|
||||||
"/notifications/",
|
"notifications/",
|
||||||
views.NotificationListView.as_view(),
|
views.NotificationListView.as_view(),
|
||||||
name="notifications_history",
|
name="notifications_history",
|
||||||
),
|
),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user