|
|
|
@ -131,7 +131,12 @@ class ProspectAdmin(SyncedObjectAdmin): |
|
|
|
ordering = ['-last_update'] |
|
|
|
ordering = ['-last_update'] |
|
|
|
filter_horizontal = ['entities'] |
|
|
|
filter_horizontal = ['entities'] |
|
|
|
actions = ['send_email', create_activity_for_prospect, mark_as_inbound, contacted_by_sms, mark_as_should_test, mark_as_testing, mark_as_customer, mark_as_have_account, declined_too_expensive, declined_use_something_else, declined_android_user, mark_as_not_concerned] |
|
|
|
actions = ['send_email', create_activity_for_prospect, mark_as_inbound, contacted_by_sms, mark_as_should_test, mark_as_testing, mark_as_customer, mark_as_have_account, declined_too_expensive, declined_use_something_else, declined_android_user, mark_as_not_concerned] |
|
|
|
raw_id_fields = ['official_user', 'related_user'] |
|
|
|
autocomplete_fields = ['official_user', 'related_user'] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def save_model(self, request, obj, form, change): |
|
|
|
|
|
|
|
if obj.related_user is None: |
|
|
|
|
|
|
|
obj.related_user = request.user |
|
|
|
|
|
|
|
super().save_model(request, obj, form, change) |
|
|
|
|
|
|
|
|
|
|
|
def last_update_date(self, obj): |
|
|
|
def last_update_date(self, obj): |
|
|
|
return obj.last_update.date() if obj.last_update else None |
|
|
|
return obj.last_update.date() if obj.last_update else None |
|
|
|
@ -492,11 +497,12 @@ class ProspectGroupAdmin(SyncedObjectAdmin): |
|
|
|
|
|
|
|
|
|
|
|
@admin.register(Activity) |
|
|
|
@admin.register(Activity) |
|
|
|
class ActivityAdmin(SyncedObjectAdmin): |
|
|
|
class ActivityAdmin(SyncedObjectAdmin): |
|
|
|
raw_id_fields = ['prospects'] |
|
|
|
# raw_id_fields = ['prospects'] |
|
|
|
list_display = ('prospect_names', 'last_update', 'status', 'type', 'description', 'attachment_text', ) |
|
|
|
list_display = ('prospect_names', 'last_update', 'status', 'type', 'description', 'attachment_text', ) |
|
|
|
list_filter = ('status', 'type') |
|
|
|
list_filter = ('status', 'type') |
|
|
|
search_fields = ('attachment_text',) |
|
|
|
search_fields = ('attachment_text',) |
|
|
|
date_hierarchy = 'last_update' |
|
|
|
date_hierarchy = 'last_update' |
|
|
|
|
|
|
|
autocomplete_fields = ['prospects', 'related_user'] |
|
|
|
|
|
|
|
|
|
|
|
def get_form(self, request, obj=None, **kwargs): |
|
|
|
def get_form(self, request, obj=None, **kwargs): |
|
|
|
form = super().get_form(request, obj, **kwargs) |
|
|
|
form = super().get_form(request, obj, **kwargs) |
|
|
|
@ -518,6 +524,11 @@ class ActivityAdmin(SyncedObjectAdmin): |
|
|
|
|
|
|
|
|
|
|
|
return form |
|
|
|
return form |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def save_model(self, request, obj, form, change): |
|
|
|
|
|
|
|
if obj.related_user is None: |
|
|
|
|
|
|
|
obj.related_user = request.user |
|
|
|
|
|
|
|
super().save_model(request, obj, form, change) |
|
|
|
|
|
|
|
|
|
|
|
def get_event_display(self, obj): |
|
|
|
def get_event_display(self, obj): |
|
|
|
return str(obj) |
|
|
|
return str(obj) |
|
|
|
get_event_display.short_description = 'Activity' |
|
|
|
get_event_display.short_description = 'Activity' |
|
|
|
|